Answered
Is PAUSE a superset of DRAWNOW?
Interesting. In the DRAWNOW doc for 2007b, PAUSE is listed in the bulleted list of events that flush the event queue. But the ...

15 years ago | 2

Answered
When to break the MATLAB rules?
I have seen good uses for EVAL. One that comes to mind is Doug Shwarz's <http://www.mathworks.com/matlabcentral/fileexchange/23...

15 years ago | 1

Answered
When to break the MATLAB rules?
One example where breaking the rules applies is the use of dynamic pre-allocation, as discussed and demonstrated in my (and Jan'...

15 years ago | 2

Answered
Telling MATLAB to wait
Do you call PLOT after every time-step? After every time-step, call PLOT then cal DRAWNOW. You can also call PAUSE with a time...

15 years ago | 2

| accepted

Answered
fill
t = (1/16:1/8:1)'*2*pi; x = sin(t); y = cos(t); h = fill(x,y,'r'); % Choose a number between 0 (invisible) and 1 (opaq...

15 years ago | 3

Answered
Setting GUI Control Default Properties by Style
When I write GUIs I usually specify the minimum property descriptions necessary for each style, then at the end of my initializa...

15 years ago | 0

| accepted

Answered
Let users enter integer, warn them if they enter anything else
a is not a string. In MATLAB a string has a single quote. This is how you enter a string: Enter an integer: 'a' When you j...

15 years ago | 0

Answered
what is wrong?
The problem is that in your first N, all of the values sum to m: m=22; N=[8,11,18,7,9,8,13;6,2,1,5,3,6,1;4,3,2,5,5,4,6;4,6,...

15 years ago | 1

Answered
Condition which reduces the size of the vector
v = [1,3,2,1,4,6,7,8,5,2]; vnew = v(v<5) % Returns: vnew = [1 3 2 1 4 2]

15 years ago | 0

| accepted

Answered
How can I train myself in working with arrays professionally?
I am afraid you are a little misinformed. Working with arrays, commonly known as using _vectorized_ code, is not *_necessarily_...

15 years ago | 1

Answered
Mouse control in GUI and contrast button access
For the first question, have a look at the WindowScrollWheelFcn (and cousins) of the GUI figure. For the second, set the menu...

15 years ago | 0

Answered
Double clicking on axes
It works fine here. How are you doing things differently than this? I can double-click all I want on the axes and the toggles ...

15 years ago | 0

Answered
"Matlab has stopped working" 2009b on Windows 7 64-bit when running a "figure" command
Does changing the renderer help? % First set the renderer. set(gcf,'Renderer','zbuffer') % Then plot your stuff...

15 years ago | 0

Answered
Matrix manipulation syntax help
Another suggestion: <http://www.mathworks.com/matlabcentral/fileexchange/23998-findsubmat FINDSUBMAT> x2 = length(findsubma...

15 years ago | 0

Answered
Elegant way to extract part of a structure as an array
vals = [s(1:2).x]

15 years ago | 25

| accepted

Answered
Change line type when figure handle is known
You could also try this tool, which allows you to make arbitrary changes with a mouse-click: <http://www.mathworks.com/matlab...

15 years ago | 1

Answered
erfc with complex number
A quick search of the FEX turned up these two. There may be others... <http://www.mathworks.com/matlabcentral/fileexchange/1...

15 years ago | 2

| accepted

Answered
Let users enter anything, save integers, give warning otherwise
A = []; while 1 userVar = input('Enter an integer, (or return to quit): '); if isempty(userVar) ...

15 years ago | 1

Answered
How to multiply a vector with each column of a matrix most efficiently?
I find the looping option fastest on my Win Vista 32 bit. Using r2007b. >> more_loop_timings Elapsed time is 0.017479 sec...

15 years ago | 5

Answered
One image input for multiple buttons and fields in a gui
So why isn't the RADI field in the handles structure? In your regblurbtn_Callback function, put this line to display what is ...

15 years ago | 0

| accepted

Answered
nested for loop
The way you have defined S, it is independent of index i. S(i,j) = ((Xone(j)-X(j))^2 + (Yone(j)-Y(j))^2)^0.5; % No i appears....

15 years ago | 0

| accepted

Answered
Output image and patch as new image
Use <http://www.mathworks.com/help/techdoc/ref/getframe.html GETFRAME> to capture what you see on the axes. For example: X =...

15 years ago | 0

| accepted

Answered
error when putting a matrix in the exp function- please review code and help me resolve! the error reads: ??? Subscript indices must either be real positive integers or logicals.
On line 28 you define: exp = expcdf(x,muhat_exp); Now you know why it is not a good idea to name variables the same name as ...

15 years ago | 1

Answered
How to check whether a structure exists?
I am not entirely sure what you want to do, but here is an example input parsing... You don't have to make your function error ...

15 years ago | 0

Answered
concatenate structs in a loop
A 1-by-n structure, where the data in each n has the same number of rows but different number of columns: A(1,1).B = [5.5 4.5...

15 years ago | 0

| accepted

Answered
Need help using colon operator with multiple matrices - I'm really close to being loopless!
I am not sure if this is in the above thread or not. But perhaps the simplest FOR loop version is this: a=[1 2 3]; b=[4 ...

15 years ago | 0

Answered
Real Time Functionality of Matlab -- I need Matlab to find an image file and open it once the image file is created.
You could set a timer callback to do this. Start by creating a list of the images in the file. This list will be updated and s...

15 years ago | 0

Answered
How to set the axes limits within a GUI
You probably need to find the handle to the axes object. Ax = findall(0,'type','axes') axis(Ax,[-1 1 -4 4]) Assuming this...

15 years ago | 0

| accepted

Answered
power law distribution - maximum likehood
I recommend you give this a thorough looking over, and get the article to which this site is a companion. They give MATLAB file...

15 years ago | 1

| accepted

Answered
Rearranging matrices
I agree with Sean de that indexing into your arrays would be easier if they were stacked in the third dimension. B = permute(...

15 years ago | 1

Load more