http://www.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2015-01-29T18:18:43Ztag:www.mathworks.com,2005:Question/1732322015-01-29T18:18:43Z2015-01-29T18:18:43Zpositive exitflag other than '1' in fmincon<p>positive exitflag message other than '1' is regarded as 'local minimum possible', which is not a guaranteed converged minimum considered by MatLab, so should I keep digging until I reach a '1' or I can simply trust solutions with exitflag message greater than '1'? Can they (greater than 1) be treated as accurate solutions to my problem?</p><p>Many thanks!</p><p>Jason</p>Jasonhttp://www.mathworks.com/matlabcentral/profile/authors/5909587-jasontag:www.mathworks.com,2005:Question/1729692015-01-28T21:01:49Z2015-01-29T18:18:23ZUsing ODE's in space and time<p>Hi,</p><p>I made a bit of a time investment to get a system of equations into an ODE format in a seperate function file. These equations are dependent on time, but I wish to define a 1D geometry. say X=0:dx:10. I created the function file so that for every time point I solve all of my X's. In my X domain I give a step for a defined time perios over a defined distance and then leave it to work itself out. The problem I am running into now is that MatLab is wanting the output to be a column vector. Currently I have it set up such that I get a 2D matrix out. Each row is a differential equation and each column is a specific place in space. This is not an acceptable output for an ODE solver it seems.</p><p>I previously went around this problem before by setting up a Euler integration approach but I am running into the limits of MatLab memory constraints and need the variable step sizes that an ODE solver gives me. I have also looked into PDEPE and am not sure that this is the solution. I am still trying to see all of the option in the toolbox but I could use a helping hand.</p><p>Thanks,</p><p>Ryne</p>Michael Hornhttp://www.mathworks.com/matlabcentral/profile/authors/5383039-michael-horntag:www.mathworks.com,2005:Question/1725492015-01-27T16:51:58Z2015-01-29T18:18:22ZHow to solve the problem Ax=b, when A is (14400,14400) and b (14400,1)?<p>When I try to solve this problem with x=A\b or rref a message saying "Out of memory" is shown.</p>Orlando Rojashttp://www.mathworks.com/matlabcentral/profile/authors/6101887-orlando-rojastag:www.mathworks.com,2005:Question/997502013-09-20T16:20:00Z2015-01-29T18:16:26ZHow do I execute a MATLAB script at a specific time each day?<p>I tried to schedule a task to run a MATLAB script at a specific time. I went to:</p><p>Start -> Programs -> Accesories -> System tools -> Schedule Task</p><p>however, this just opens the MATLAB file, does not run it.</p>MathWorks Support Teamhttp://www.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:www.mathworks.com,2005:Question/1732312015-01-29T18:15:38Z2015-01-29T18:15:38ZI'm creating 2 custom menu entries in GUI somehow. Any suggetions?<p>I've made sure the relevant figure properties are set to none and then deleted the 2 custom menu entries using the menu entries. When I run the GUI from guide, the menu bar shows up with 2 custom menus. I can't see these in the guide menu editor until I exit and restart guide.</p><p>I think I must be overwriting something somewhere, but need a hint where to look.</p><p>Any ideas??</p><p>thanks, Dan</p>Danhttp://www.mathworks.com/matlabcentral/profile/authors/1457182-dantag:www.mathworks.com,2005:Question/1732272015-01-29T17:08:27Z2015-01-29T18:04:06ZHow to rewrite a loop in a logical way?<p>I have this loop but it takes too much time for processing it because of the big amount of elements of "x" and "y"... I have tried to write it in a more compact way but it was not successful... I have an image "im_raw" with "2546x3318" elements. It has a lot of holes which are set with "nan" values and I need to fill these "nan" values with the maximum of a submatrix around each gridpoint (9x9 neighbours). So where I have stopped is in this point when I have to find for each gridpoint, which must coincide with the x and y which contain the coordinates where the "nan" values are located and I want to replace by the maximum of that submatrix (9x9) centered in each gridpoint. Could somebody take a look at this example and send me a feedback? I would appreciate it... Thanks in advance.</p><p>for i = 10:max(x(:,1))-9</p><pre> for j = 10:max(y(:,1))-9</pre><pre> im_raw(x(i,1),y(j,1)) = max(max(im_raw(i-9:1:i+9,j-9:1:j+9))) </pre><pre> end</pre><p>end</p>Antonio Sanchis-Dufauhttp://www.mathworks.com/matlabcentral/profile/authors/6118861-antonio-sanchis-dufautag:www.mathworks.com,2005:Question/1727672015-01-28T11:55:43Z2015-01-29T18:03:25ZNeural Network retrieve test dataset to plot<p>I am wanting to retrieve the data in the 'test' plot from training so that I can plot the data myself in a different format.</p><p>I can access the training, validation, test indices using [tr] but how do I find the network outputs for these to plot against the targets?</p>Lucyhttp://www.mathworks.com/matlabcentral/profile/authors/3740138-lucytag:www.mathworks.com,2005:Question/1732002015-01-29T16:23:35Z2015-01-29T18:02:02ZFind whether a vector occurs exactly in another vector<p>Hi,</p><p>I try to compare two vectors (waveforms from wav files). One is the original sound file and the other is a manipulated sound file. I try to find the indices in the original sound file that match with the manipulated sound file. In the end, I would like to plot the original sound file and highlight the parts that were manipulated.</p><p>Loading the files into Matlab is no problem, but finding a way to compare/match the files is difficult. I tried the "ismember" function, but I think this function will try to find a match for each datapoint whereas I need something that matches a complete vector with original sound files.</p><p>Any suggestion on how to find whether a small vector occurs exactly in another longer vector?</p><p>Best,
Mark</p>Markhttp://www.mathworks.com/matlabcentral/profile/authors/1264025-marktag:www.mathworks.com,2005:Question/1731742015-01-29T15:57:40Z2015-01-29T18:00:42Zextracting smaller matrices from a larger matrix through loop<p>hi all
i have lets say a 100*2 matrix, like x data and corresponding y data. i want to divide or partition this in to 10 parts, like one part= x1 y1... x10 y10 2nd part x11 y11...x20 y20.. and so on. ie., i want to partition this 100*2 matrix in to ten 10*2 matrices. how can i do that through a loop? because i want each of these partitions and save them separately for plotting and other purposes. i am a beginner in matlab scripting. please could you help me?
thanks in advance
johan mark</p>matlab beginnerhttp://www.mathworks.com/matlabcentral/profile/authors/6118579-matlab-beginnertag:www.mathworks.com,2005:Question/1729832015-01-28T23:56:57Z2015-01-29T17:57:06ZProblems with TRAIN command<p>I'm using the Neural Network Toolbox. I've used Matlab before and I don't have any problem. Even when I use the command FEEDFORWARDNET I'm able to create a Neural Network.
Now I'm trying to train it, so I declare inputs and outputs. However, when I use TRAIN, Matlab closes suddenly. I've proven the same instructions in other computers and it works, only happens in my computer a only with that command.
Do you have any idea of what is happening?
Thank you. Sorry for bad english.</p>Gerardo Alonso Quiñoneshttp://www.mathworks.com/matlabcentral/profile/authors/6115976-gerardo-alonso-quinonestag:www.mathworks.com,2005:Question/1732302015-01-29T17:55:47Z2015-01-29T17:55:47Zhow to remove background of this image<p>I converted to Gray scale
I=imread(image)
j=rgb2gray(I)</p>jesan sebastianhttp://www.mathworks.com/matlabcentral/profile/authors/6119038-jesan-sebastiantag:www.mathworks.com,2005:Question/1729942015-01-29T02:42:44Z2015-01-29T17:55:40ZHow to get max/min temp data from hourly data?<p>Hi,</p><p>I have a dataset of hourly data for a 30+day period and have no clue where to start to get the daily min and max temperatures for each day of this period? Can anyone help me? Imagine that column1 is the day of year, column 2 is the time, and column 3 is the hourly temp.</p>JAG2024http://www.mathworks.com/matlabcentral/profile/authors/4821109-jag2024tag:www.mathworks.com,2005:Question/1731512015-01-29T14:06:27Z2015-01-29T17:55:22ZIntelligent algorithm for classification<p>hi everybody.
i need to classify some data using an algorithm such as neural network. but as you know it doesnt accept inf values.does anybody know about an intelligent algorithm for classification which can deal with inf values?
please help me if you can. thank you</p>maryamhttp://www.mathworks.com/matlabcentral/profile/authors/4521399-maryamtag:www.mathworks.com,2005:Question/1732252015-01-29T16:58:01Z2015-01-29T17:53:46ZImport text file with blank lines. Matlab not replacing them with NaN <p>Matlab is not replacing my blank lines in my txt file with NaN but just joins all the data together. Unfortunately I need to data in the exact order it is as each line is a unique timestamp but the times are do not come in the txt file.</p><p>Any ideas? Tried importdata and textscan with no luck. Using R2014b</p>Masao Ashtinehttp://www.mathworks.com/matlabcentral/profile/authors/4739967-masao-ashtinetag:www.mathworks.com,2005:Question/1731752015-01-29T15:58:05Z2015-01-29T17:43:18ZError using integral with variable in denominator. Works without<p>e:// edited, to make code runnable without the rest of the file. Still same probs.</p><pre class="language-matlab">x = -0.5:0.1:0.5;
y = -0.5:0.1:0.5;
[X,Y] = meshgrid(x,y);
yMid = 3;
coilRadius = 0.2;
iCoil = 2;
coilSeparation = 0.2;
magnetZExamStyle = zeros(1,10);
parfor i = 1:10
examFormula = @(phi) 10^-7 * iCoil * coilRadius * (coilRadius - X(i,yMid)*cos(phi)) / (X(i,yMid)^2 + coilRadius^2 - 2*cos(phi)*coilRadius*X(i,yMid) + coilSeparation^2)^(3/2);
magnetZExamStyle(i) = integral(examFormula,-pi,pi);
end
</pre><p>Using this code, I get the error message:</p><pre class="language-matlab">Error using
@(phi)10^-7*iCoil*coilRadius*(coilRadius-X(i,yMid)*cos(phi))/(X(i,yMid)^2+coilRadius^2-2*cos(phi)*coilRadius*X(i,yMid)+coilSeparation^2)^(3/2)
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
</pre><pre class="language-matlab">Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
</pre><pre class="language-matlab">Error in integralCalc/vadapt (line 133)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
</pre><pre class="language-matlab">Error in integralCalc (line 76)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
</pre><pre class="language-matlab">Error in integral (line 89)
Q = integralCalc(fun,a,b,opstruct);
</pre><pre class="language-matlab">Error in SingleCoilImproved (line 49)
parfor i = 1:xMax
</pre><pre class="language-matlab">Caused by:
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
</pre><p>Omitting the ^(3/2), yields a different error message, stating that I cannot use matrix valued functions. So the problem must be in the denominator.</p><p>After some experimenting, I realized that omitting the cos(phi) yields a working, but obviously useless program.</p><p>I found a way to calculate the stuff I want, by using syms phi and putting the same formulae in the int() function. But this is very slow and yields a warning in every step, that the analytic integral could not be found.</p><p>What is the problem with the integral function. And is there a way to fix it or do I have to use another function?
All variables are real doubles, X is a 2D matrix of real doubles.</p><p>I am using Matlab R2013a with a student's license. The code is used in a standard .m script without interaction with other scripts.</p>Philippe Wenkhttp://www.mathworks.com/matlabcentral/profile/authors/6118546-philippe-wenktag:www.mathworks.com,2005:Question/848232013-08-15T15:16:46Z2015-01-29T17:27:37ZHow to generate scores for fusion?<p>Hello all,</p><p>I have to implement a multimodal biometric using score level fusion and having palm print and dorsal hand vein as biometrics. I have used Euclidean distance for matching when working on the unimodal of each respective biometrics.</p><p>For the multimodal approach, I have to get the scores for the palm print and dorsal hand vein separately so that I can perform score normalization.</p><p>My problem is how do I get the scores? Is it the same value that we used when conducting Euclidean distance in the unimodal or something else?</p><p>Thank You.</p>Shirahhttp://www.mathworks.com/matlabcentral/profile/authors/3944258-shirahtag:www.mathworks.com,2005:Question/1729802015-01-28T23:24:58Z2015-01-29T17:25:49ZmexCallMatlab failing to return<p>I'm using C to process a stream of images from a file, this C function is called from an M-file. The image stream is being parsed using a separate Matlab function, so in my C loop for all images I use mexCallMatlab to call that Matlab function to parse the image file structure. For the most part this appears to work fine, but for some image streams it crashes (it appears to only happen with longer streams but I can't swear to that as it's currently happening at image 327 and 630 for two different files so not consistent). The image stream is proprietary, but basically an XML wrapper around raw image data.</p><p>The weird thing is it does not throw an error it just hangs and sits there indefinitely. Matlab doesn't appear to be using any more processing power or memory than usual and everything runs fine. The only way to get out of it (that I know of) is Ctrl-q which kills Matlab, Ctrl-c does nothing.</p><p>Since I don't have a good way to debug the C I'm using print statements. The last line of the Matlab function is:</p><p>disp(frame)</p><p>and the next line in the C file is</p><p>mexPrintf("Image %d returned\n",i);</p><p>After some number of iterations through the loop I see the frame number get printed but I never see the "Image XX returned", the cursor just sits there and does nothing, I do not get returned to the command prompt.</p><p>Unfortunately I can't share much of my code but here are what I believe are the important excerpts. I played with the memory management a lot as I figured it was something like that causing the problem, but I'm not so sure since it's inconsistent, here's what I've settled on anyway:</p><p>mxArray* file_info;
mxArray* return_array[2];</p><p>...</p><p>file_info = mxDuplicateArray(prhs[0]);</p><p>...</p><p>mexCallMATLAB(2, return_array, 1, &file_info, "getCurrentFrame");
mxDestroyArray(file_info);
file_info = mxDuplicateArray(return_array[1]); //Copy the updated file info structure</p><p>...</p><p>For All Images
{</p><pre> mexPrintf("Processing image %d of %d - ",i,N_images);
mexCallMATLAB(2, return_array, 1, &file_info, "getCurrentFrame");
mexPrintf("Image %d returned\n",i);
mxDestroyArray(file_info);
file_info = mxDuplicateArray(return_array[1]); //Copy the updated file info structure</pre><pre> <Processing>
}</pre><p>Here's what I see on the console (note there's an intentional offset in the image numbering between the Matlab and C):</p><p>...</p><p>Processing image 624 of 1460 - 628</p><p>Image 624 returned</p><p>Processing image 625 of 1460 - 629</p><p>Image 625 returned</p><p>Processing image 626 of 1460 - 630</p>Pathttp://www.mathworks.com/matlabcentral/profile/authors/5623006-pattag:www.mathworks.com,2005:Question/1732292015-01-29T17:21:37Z2015-01-29T17:21:37ZPatter search optimization, not getting fittest solution<p>Have adapted a code a GA code to run with PS but it get to a solution after a few iterations and can not find a fitter solution. I can manually find better solution by changing around the variable.</p><p>Keeps on refining the mesh without finding a better solution:</p><p>48 393 36176.4 9.537e-07 Refine Mesh
Optimization terminated: mesh size less than options.TolMesh.</p>Mohttp://www.mathworks.com/matlabcentral/profile/authors/5682186-motag:www.mathworks.com,2005:Question/1731662015-01-29T15:09:34Z2015-01-29T17:13:35ZHow to create an envelope on a specific signal<p>could anybody please guide me how i can find the lower & upper envelope on a signal? would you give me a simple example?thank you</p>maryamhttp://www.mathworks.com/matlabcentral/profile/authors/4521399-maryamtag:www.mathworks.com,2005:Question/1732282015-01-29T17:13:23Z2015-01-29T17:13:23ZPDE Toolbox solution array along a line, to then find the mean value<p>I'm have solved Poisson's equation for simple rectangular geometry using the PDE Toolbox. I exported the solution and mesh and now I want to find u along a line so that I can then find its average.</p><p>It is a rectangle with bottom boundary at y = -0.8 and x = -0.5 to 0.4. This is what I was trying to type in the command line:</p><pre class="language-matlab">F = pdeInterpolant(p,t,u);
x = -0.5:0.4;
y = -0.8;
uOut = evaluate(F,x,y)
</pre><p>But this only returns one value. I am looking for an array of values so that I can use mean(uOut) to find the average.</p><p>I also want to find the the mean normal component of u into the page at the same position.</p><p>Any help greatly appreciated.</p>Ahttp://www.mathworks.com/matlabcentral/profile/authors/4717665-atag:www.mathworks.com,2005:Question/1732262015-01-29T17:05:05Z2015-01-29T17:15:21ZHow to do symbolic substitution<p>Hi all,
While deriving an equation, I got into trouble when trying to do symbolic substitutions. For example for a symbolic expression 4a+7b, I need a substitution for (a+b), say c, which returns output as 4c+3b. Please give your valuable suggestions.
Thank You in advance</p>Harish Chttp://www.mathworks.com/matlabcentral/profile/authors/5476768-harish-ctag:www.mathworks.com,2005:Question/1732242015-01-29T16:57:32Z2015-01-29T16:57:32ZIs there a better Fourier Transform algorithm to use in Image recognition<p>I have been trying to use the Fourier transform in recognizing images of the same size 200X400.</p><p>I have tried many different ways to do that such as:</p><p>1 - performing the Fourier on the full image and then try to match it with the ones in the database. the accuracy rate was very bad.</p><p>2 - performing the Fourier on the full image and then take only the submatrix contained in center of the image and then match it with the ones in the database. the accuracy rate was also very bad.</p><p>3 - performing the Fourier on the full image and then take only the horizontal and vertical vector that intersect in the center of the image, and then match it with the ones in the database. also, the accuracy rate was very bad.</p><p>Is there any better algorithm that might help me solve this problem?</p><p>Thank you very much</p>alladinhttp://www.mathworks.com/matlabcentral/profile/authors/5452474-alladintag:www.mathworks.com,2005:Question/490082012-09-25T07:59:12Z2015-01-29T16:52:56Zremez function not working<p>I am using the remez function in a Filter and impulse response exercise. It is however giving me an error "??? Index exceeds matrix dimensions." Below is the short code where the error is coming in:</p><p>N = 41;
F = [0 F1 F2 1];
M = [0 0 1 1];
B = remez(N-1,F,M)</p><p>I am struggling to figure out what it is I am doing wrong</p>Nickohttp://www.mathworks.com/matlabcentral/profile/authors/3699895-nickotag:www.mathworks.com,2005:Question/417662012-06-21T20:11:08Z2015-01-29T16:49:29ZRead Adams/Car results files (.res or .req) with Matlab<p>Hi... does anybody knows if there is a function or a toolbox that can help me open MSC Adams/Car results files (i.e. .res or .req)?. I would appreciate your comments.
Regards</p>Gerardohttp://www.mathworks.com/matlabcentral/profile/authors/3542585-gerardotag:www.mathworks.com,2005:Question/1731422015-01-29T13:16:17Z2015-01-29T16:48:03ZSimulink scope y axis values not visible<p>Why does simulink scope chop off the digits (most significant) in the y axis if the values have more than 4 digits after the decimal point? Is there a workaround to fix this?</p><p>The y axis of the middle scope in the attached figure illustrates the problem.</p><img src = "/matlabcentral/answers/uploaded_files/24624/Untitled.png">Vivashttp://www.mathworks.com/matlabcentral/profile/authors/4634615-vivastag:www.mathworks.com,2005:Question/1732232015-01-29T16:42:13Z2015-01-29T16:42:13ZHow to map an image from pixel coordinates to real world coordinates<p>Can someone help me with the following problem?
My goal is to transform an image of a target (e.g. chessboard) with known dimensions and than transform that image in a way, that the chessboard pattern is horizontally and vertically aligned with the pixel coordinate system. I found a lot of nice tools to dewarp or register images (the camera calibration toolbox of Jean-Yves Bouguet for example) but so far I couldn't find anything of how to transform the image so that the x- and y-pixels correspond to real-world length scales.
Can someone give me a hint where I can find a solution to that problem?</p>Carl-Philipphttp://www.mathworks.com/matlabcentral/profile/authors/4203012-carl-philipptag:www.mathworks.com,2005:Question/1729472015-01-28T17:56:11Z2015-01-29T16:40:44ZHow converting S-parameter to another with different impendance per port?<p>Hi,</p><p>I would like to convert a mixed-mode S parameter onto another with different terminations and more specificatlly different impedance per port since the terminations can be different between differential and common modes for some reasons. I guess I am looking for a function similar to s2s but where I can put a vector of impendance with different values, one per port. Is it possible with the RF toolbox? how?</p><p>Denis</p>Denishttp://www.mathworks.com/matlabcentral/profile/authors/259531-denistag:www.mathworks.com,2005:Question/110122011-07-06T16:55:27Z2015-01-29T16:40:01ZBode<p>I am new to Matlab. I need to use the Bode command. When I run my code, I get this error: "Undefined function or method 'bode' for input arguments of type 'double'."</p>Diego Aguilerahttp://www.mathworks.com/matlabcentral/profile/authors/2734629-diego-aguileratag:www.mathworks.com,2005:Question/1732222015-01-29T16:39:31Z2015-01-29T16:39:31ZWhy my Matlab2014b doesn't find function bode or function tf?<p>Hi there, I just got Matlab2014b and I look that Matlab doesn't find the function of TF or BODE, in my last version 2013a there were correctly... what is the problem now??
thanks,
Ruben</p>Ruben Ubedahttp://www.mathworks.com/matlabcentral/profile/authors/6069822-ruben-ubedatag:www.mathworks.com,2005:Question/1731712015-01-29T15:43:07Z2015-01-29T16:34:29ZMaximum Number of Rows in Matlab<p>I'm importing large text files. What is the maximum number of rows Matlab can handle?</p>Todd Gilberthttp://www.mathworks.com/matlabcentral/profile/authors/6118537-todd-gilberttag:www.mathworks.com,2005:Question/1732112015-01-29T16:26:55Z2015-01-29T16:34:12ZADDING VECTORS IN MATLAB <p>DEAR SIR,I HAVE A VECTOR SOMETHING LIKE A=[0 0 0 1 1 1....1].I NEED TO ADD THIS 1102 TYMES.LIKE A+A+A+.... 1102 TIMES LIKE THIS.IT TAKES TOO MUCH TIME TO DO IT MAUNALLY.CAN U TELL A MATLAB CODE FOR THIS...</p>POOJA KJhttp://www.mathworks.com/matlabcentral/profile/authors/5344413-pooja-kjtag:www.mathworks.com,2005:Question/1254712014-04-11T20:41:38Z2015-01-29T16:30:04ZUsing the .NET object System.IO.FileSystemWatcher in a compiled standalone program<p>I am using the .NET object System.IO.FileSystemWatcher to execute a command when a new file appears in a selected directory. The function works as expected when I run my script through Matlab. I then compile my script into a standalone windows executable and it no longers works.</p><p>Is the .NET functionality simply not avaiable in a compiled Matlab program? I looked at the help page for compiler limitations and did not see anything that would rule out what I'm doing. Additionally, I checked the mccExcludedFiles.log file and it did not contain any excluded functions.</p><p>I am compiling with Matlab 2009b and have the MCR v7.11 installed. Any advice on this matter would be much appreciated.</p>Johnathanhttp://www.mathworks.com/matlabcentral/profile/authors/4224015-johnathantag:www.mathworks.com,2005:Question/1731582015-01-29T14:25:54Z2015-01-29T16:24:18Zhelp find two closet node with their index ..distance = sqrt((xd-x(I))^2 + (yd-y(I))^2) <p>help find two closet node with their index ..distance = sqrt((xd-x(I))^2 + (yd-y(I))^2)</p>maha ismailhttp://www.mathworks.com/matlabcentral/profile/authors/5774280-maha-ismailtag:www.mathworks.com,2005:Question/1731992015-01-29T16:15:37Z2015-01-29T16:15:37ZCan you help me please convert this pseudo code of beacon-less broadcasting algorithm into MATLAB?<p>1: A source node S ∈ H0 send a data packet P.
2: Initialization:
ID(vp) = ID(S), location(vp) =
location(S), colour(Hp) = colour(H0), k = 0.
{Case 1: Node v ∈ Hv has received the data packet P
from node u ∈ Hv to cover level k.}
3: if v has a contention timer running for P then
4: v cancels its timer and ignores P.
5: end if
{Case 2: Node v ∈ Hv has received the data packet P
from node u ∈ Hu to cover level k.}
6: if Hv �⊂ C(Hu) then
7: Node v ignores the data packet P.
8: else if v or any v� ∈ Hv has already forwarded P then
9: v ignores the data packet P.
10: else
11: Node v starts a contention timer th + tc.
{Upon the expiration of th + tc}
12: if Hv is blue then
13: if v has not heard P from any other w ∈ Hv then
14: update(v, P)
15: v forwards the data packet P
16: end if
17: end if
18: if Hv is yellow or pink hexagon then
19: if v covers any additional hexagons on level k that
are not yet covered then
20: update(v, P)
21: v forwards the data packet P
22: else if v covers additional hexagons in C(Hv) then
23: v starts a contention timer th + tc.
24: if upon the expiration of th + tc v covers any
additional hexagons in C(Hv) then
25: update(v, P)
26: v forwards the data packet P
27: end if
28: end if
29: end if
30: end if</p>E Bhttp://www.mathworks.com/matlabcentral/profile/authors/6118657-e-btag:www.mathworks.com,2005:Question/1731982015-01-29T16:14:12Z2015-01-29T16:14:12ZCreating a figure in guide programmatically is not functioning properly<p>So apparent I am not reading my code clearly or something strange is happening but every time I run this the it only creates one of the four figure which is normal but then when I click again it does not show anything.</p><p>So in my code... `CounterB` is the counter of how many figures there are which is mapped to `uicontrol_ix`.</p><p>`CounterC` does nothing</p><p>Also there are some redundancy but I don't think matter much unless it affected the code which I can't tell.</p><pre class="language-matlab">function bot_mt_add_Callback(hObject, eventdata, handles)
uicontrol_ix = str2double(get(handles.CounterB,'String'));
disp(uicontrol_ix);
if lt(uicontrol_ix,size(get(handles.bot_masstrans_2,'String'),1))
set(handles.CounterB,'String',...
(sprintf('%d',int32((str2double(get(handles.CounterB,'String')))+1))));
</pre><pre> set(handles.CounterC,'String',...
(sprintf('%d',int32((str2double(get(handles.CounterC,'String')))-24))));</pre><pre> uicontrol_ix = str2double(get(handles.CounterB,'String'));
% positiony = str2double(get(handles.CounterC,'String'));
positiony = -24;
handle1 = sprintf('handles.bot_masstrans_2_%d',int32(uicontrol_ix));
handle2 = sprintf('handles.bot_masstrans_3_%d',int32(uicontrol_ix));
handle3 = sprintf('handles.bot_masstrans_4_%d',int32(uicontrol_ix));
handle4 = sprintf('handles.bot_masstrans_5_%d',int32(uicontrol_ix));</pre><pre> disp(uicontrol_ix);
% if uicontrol_ix == 1
uicontrol('Parent',handles.uipanelb,'Style', 'popup',...
'String',(get(handles.bot_masstrans_2,'String')),...
'Position',(get(handles.bot_masstrans_2,'Position'))+[0 positiony 0 0],'Tag',handle1); %'Callback', @setmap,</pre><pre> uicontrol('Parent',handles.uipanelb,'Style', 'popup',... % findobj('Tag','uipnelb') = handles.uipanelb
'String',(get(handles.bot_masstrans_3,'String')),...
'Position',(get(handles.bot_masstrans_3,'Position'))+[0 positiony 0 0],'Tag',handle2); %'Callback', @setmap,</pre><pre> uicontrol('Parent',handles.uipanelb,'Style', 'edit',...
'String','0','Position',(get(handles.bot_masstrans_4,'Position'))+[0 positiony+2 0 0],'Tag',handle3); %'Callback', @setmap,</pre><pre> uicontrol('Parent',handles.uipanelb,'Style', 'edit',...
'String','0','Position',(get(handles.bot_masstrans_5,'Position'))+[0 positiony+2 0 0],'Tag',handle4); %'Callback', @setmap,</pre>Tamfor Dulinhttp://www.mathworks.com/matlabcentral/profile/authors/5517954-tamfor-dulintag:www.mathworks.com,2005:Question/1731722015-01-29T15:43:41Z2015-01-29T16:10:47ZOOP Editing/Programming Environment<p>Hi,</p><p>I'm starting OOP-programming in Matlab. What is bugging me at the moment is that my best choice moving between methods or rechecking property names, etc. is PgUp/Down/Pos1/End or Strg-F.
Currently I am using a R2010a student version.</p><p>Is there any external programming environment or some tricks I overlooked that help navigating easier in my code, like for many other programming languages?
Like displaying some window with bookmarks for my methods, so I can jump to them with oneclick, etc.
Are you all just using the Matlab supplied editor or are there any other editors that do a better job.</p><p>Thx for any help</p>Svenhttp://www.mathworks.com/matlabcentral/profile/authors/5930332-sventag:www.mathworks.com,2005:Question/1595802014-10-21T21:57:17Z2015-01-29T16:06:12ZIn MATLAB 2014b, how can I undock the editor into one window but dock all my scripts into that single window? (not dock them into the command window)<p>I just don't understand this. Can someone please help?</p>Mohammad Hossainhttp://www.mathworks.com/matlabcentral/profile/authors/3866740-mohammad-hossaintag:www.mathworks.com,2005:Question/1731972015-01-29T16:05:27Z2015-01-29T16:05:27ZAfter update OpenSUSE LINUX 12.2 to 13.1 on server, the license manager has not started<p>I have Installed license manager to server with OpenSUSE 12.2 and it worked perfectly!
Whenever I made necessary update OpenSUSE to version 13.1, the license manager doesn't start:</p><pre class="language-matlab">server:/ # /usr/local/MathWorks/etc/lmstart -u administrator
</pre><pre class="language-matlab">Checking license file for local hostname and local hostid . . .
</pre><pre class="language-matlab">Taking down any existing license manager daemons . . .
</pre><pre> No license manager daemons running . . .</pre><pre> Starting license manager . . .</pre><pre> Debug logfile = /var/tmp/lm_TMW.log
The license manager has not started properly.
Check the logfile for any error messages.</pre><pre> server:/ # </pre><p>The file /var/log/lm_TMW.log stays empty...</p><p>Where do I have the problem?
... There is the new Install Mathworks necessary?</p><p>Thank you very much for your help!</p>Libor Machalahttp://www.mathworks.com/matlabcentral/profile/authors/879332-libor-machala