Answered
Set limit for secondary y-axis
Use the handle to the second y-axis: [ax h1 h2] = plotyy(1:10,1:10,1:10,10:-1:1); ylim(ax(2),[0 pi]);

14 years ago | 1

| accepted

Answered
How to plot vector from data
Do you have a data point and corresponding vectors components for each of those (0,1), (0,2) etc.? If you don't have points d...

14 years ago | 0

Answered
Issue with mean function
Sure, you could do this with |mean()| and a couple of |for|-loops but |conv2()| is way cooler: xm3x3 = conv2(x,ones(3)*mean...

14 years ago | 0

Answered
Surface with 4th argument for color
Sure, use the fourth argument as an index into your colormap's colors, much like I did here: <http://www.mathworks.com/matlab...

14 years ago | 0

| accepted

Answered
Changing a popup menu by changing an edit text box
The edit |uicontrol|'s callback function should get it's string and set something else in the popup. *More per comments* I...

14 years ago | 1

| accepted

Answered
Plot multiple surfaces on same plot with different color for each surface
Like this: figure;hold on [xx yy] = meshgrid(1:10); colormap([1 0 0;0 0 1]) %red and blue surf(xx,yy,rand(10),ones(10));...

14 years ago | 4

Answered
Toggling a radio button when switching popup menu options
This will be done in the same way as editting the strings in your previous questions. You will have to |get()| the information ...

14 years ago | 1

| accepted

Answered
Using a GUI popup menu to change an Edit Text box
After the popup menu returns and gives you the information you need, extract this information and then |set| the _'string'_ prop...

14 years ago | 1

Answered
Problems with while function
How about |fzero()| to find where 'f(x)-0.0125 = 0'?

14 years ago | 0

Answered
Which GUI to use?
Who told you GUIDE was phasing out? # GUIDE or Handle Graphics. The learning curve for handle graphics is a little steeper b...

14 years ago | 0

| accepted

Answered
Maximize size of a 3D matrix
You must be on a 32 bit system and have already used much of your memory. On a 64bit system you can make that matrix no problem...

14 years ago | 0

Answered
quick search in two vectors
You might want to look at |ismember()| with the _'rows'_ flag. Keep column vectors vb, va together in one matrix as v. I don't ...

14 years ago | 0

Answered
creating a matrix from different sized arrays
<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F FAQ> This should get you start...

14 years ago | 0

Answered
Picking indices randomly
idx1 = find(A==1); idxkeep = randperm(numel(idx1),how_many_you_want); idx12keep = idx1(idxkeep);

14 years ago | 0

| accepted

Answered
Real value to binary
doc dec2bin

14 years ago | 0

| accepted

Answered
Matrix element counting by rows, histograms, etc.
Why would you want to do this? You have all of the information you need in a nice condensed easy to understand package...

14 years ago | 0

Answered
Combine two different matrices to create one new matrix of all matrix combinations
Nice brain teaser! %Sample data: A = ones(4,4,5); B = bsxfun(@times,ones(4,4,3),cat(3,1,2,3)); %Nice to know: sz...

14 years ago | 2

| accepted

Answered
Error in genetic algorithm in toolbox
What functions are you using? What code are you calling them with? If you run: dbstop if error to stop with the debu...

14 years ago | 0

| accepted

Answered
pan cancels WindowKeyPressFcn callback...
Hi Razvan, I think this thread might interest you: <http://www.mathworks.com/matlabcentral/answers/33224-gui-figure-focus>...

14 years ago | 0

Answered
how to step out of a for loop
The only thing I can think of to do this is to set an if condition on a variable that you would modify while debugging. E.g: ...

14 years ago | 1

| accepted

Answered
Error occurs in "aviread" . URGENT
<http://www.mathworks.com/support/solutions/en/data/1-4G50RI/index.html>

14 years ago | 0

Answered
How do I capture the output from "display"
It can be done using |evalc|, though I wouldn't recommend it: x = evalc('disp(''hello world'')'); I would recommend gene...

14 years ago | 2

Answered
for-end loop with increment and movie
First, make sure to use |drawnow| to refresh the graphics queue between loop iterations. Second, use the |for|-loop variable ...

14 years ago | 0

Answered
retrieve circle position from equation or data array
imshow(h.createMask) If you look at the |methods()| of an |imellipse| object, it's one of the freebies! methods(h) ...

14 years ago | 1

Answered
finding the minimum value
Use the second output argument from |min()| and the correct _dim_ input to |min()| to tell you where the minimum is.

14 years ago | 0

Answered
Different results when running the same MATLAB program on different version of MATLAB
Are they on the same computer? I would recommend not relying on something on the order of EPS. ( |doc eps| for more info).

14 years ago | 2

Answered
Perceptron : how to change bias in matlab?
Modify |net.b| (the bias component of the net)?

14 years ago | 0

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

14 years ago

Answered
MATLAB: error using drawnow: Interrupt while evaluating uicontrol Callback
The moral of the story is: *Don't use a |while| loop for this!* When the mouse is pushed the |windowbuttondownfcn| callback i...

14 years ago | 0

| accepted

Solved


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

14 years ago

Load more