Answered
Using the find function in a loop
Is it possible that your find command is returning multiple results? If so, putting multiple results into a single element of a...

15 years ago | 1

Answered
matrix pre-allocation
There are cases where loops are much faster than other alternatives. This can sometimes be difficult to predict ahead of time, ...

15 years ago | 1

Answered
sequence grouping
Does this do what you are wanting? Lp = length(piv); G = ones(Lp,2*Lp+1); G(:,1) = piv-Lp; G = cumsum(G,2); D{1} = m...

15 years ago | 0

| accepted

Submitted


LINECMENU
Utility for creating a standard uicontextmenu for line objects.

15 years ago | 1 download |

5.0 / 5
Thumbnail

Answered
Passing data between two different GUI windows
Assuming you are using GUIDE to generate your GUIs, you can simply use the tag of the editbox in the first GUI to find it in the...

15 years ago | 1

| accepted

Answered
how to connect dots
What dots? You need to be _way_ more specific to get any advice for this issue...

15 years ago | 0

Answered
Indexing matrix in matlab
You could put them into a cell array: C = {magic(3) ones(3) zeros(3) magic(3) magic(3) ones(3)*6 zeros(3)}; isequal(C{1}...

15 years ago | 0

Answered
Plotting Edge Data on Mesh Plots
You could use PATCH to specify the edges.

15 years ago | 0

Answered
Displaying text in the command window when running a program
What do you want to display? You can use the DISP command without a variable. disp('At line 50')

15 years ago | 10

| accepted

Answered
Compactly display a matrix
For this kind of thing I wrote my own custom display function, which uses the FPRINTF command for the formatting. I don't know ...

15 years ago | 0

Answered
Loop, function or memory problem: Loop variable in a function is limited automatically.
Hmm, something weird is going on. Can you verify that this works at the command line: for ii = 1:512*512*100,jj = ii/2;end,jj...

15 years ago | 0

Answered
Subtract corresponding nonzero element from each element in a vector
Try this for speed. On my machine it is much faster than the double BSXFUN call. I assume random V1 (your Vect1). . . . *...

15 years ago | 0

Answered
Write a program that calculates sum of the integers numbers
The product would be the sum of the even integers from 2 to 30 ;-). Seriously, what have you tried so far on this homework pro...

15 years ago | 1

Answered
Why are questions showing up with WRONG authors?
Bad link, I think...

15 years ago | 0

Answered
Error: File: cftool.m Line: 355 Column: 33 Unexpected MATLAB operator
All that those tildes mean is the input arguments are not used in the function. Try changing the code to this: function adju...

15 years ago | 0

Answered
extract numbers from a cell array
N = cellfun(@(x) str2double(x(13:16)),G) % G is your cell array.

15 years ago | 0

| accepted

Answered
Plotting a variable as a function of the iteration number in a for loop
Here is an example. Note that if your loop index is 1-to-N, then you won't need the loop counter and this can be simplified in ...

15 years ago | 0

| accepted

Answered
How to create a (nxn) matrix with alternating sign
Here is another which works for even or odd n. M = toeplitz((-1).^(1:n)); And even faster (very much so for large n!).....

15 years ago | 1

Answered
Problem in drawing
I get a graph, why do you say you don't get a graph? You don't say what to use for the requested input, so I used 10000. Is th...

15 years ago | 0

| accepted

Answered
Create a function to calculate hyperbolic's then graph them?
About the only thing you might want to change is to put a call in to the HOLD function so that all plots appear on the same axis...

15 years ago | 0

| accepted

Answered
Solving using Euler method
What is 'i'? In MATLAB , 'i' and 'j' are functions. This is one reason why it is recommended not to use them as loop indices. ...

15 years ago | 0

Answered
Pe versus the signal amplitude A
Did you mean to plot: semilogy(A.',P,'b.-'); Also, I would recommend you not name your variables the same name as MATLAB fu...

15 years ago | 1

| accepted

Answered
Connected Pop-ups
Yes it is possible. STR = {'a';'b';'c'}; % Use for popup1; STR2 = {{'f';'g';'h'};{'i';'j';'k'};{'l';'m';'n'}}; % popup2 ...

15 years ago | 0

| accepted

Answered
Help in n factorial!!!
What do you mean you don't understand the question? I find this very difficult to believe. You know what it is to write a prog...

15 years ago | 2

Answered
Find first 1 of the first sting of 1s who's length exceed the length of every subsequent string of 0s
Here is a function which seems to always work, and is fast. I have had trouble with Walter's solution returning wrong results o...

15 years ago | 1

| accepted

Answered
How do write a function within the same main code
Put all of this into one M-file. Then call it like this: get_sub(5) function [OUT] = get_sub(A) OUT = subfun(A); %...

15 years ago | 1

| accepted

Answered
Integration help (quad)
Why not use an anonymous function instead? >> y = @(th) cos(th).*sin(th); % The function to integrate... >> q = quad(y,0...

15 years ago | 0

| accepted

Answered
How to find a code for 1 D convection diffusion equation?
A good place to start is the FEX. I pulled this one up after one search. <http://www.mathworks.com/matlabcentral/fileexchange/...

15 years ago | 0

Answered
How do I vary color along a 2D line?
This is one of the classic 'tricks' of MATLAB graphics. x = 0:.05:2*pi; y = sin(x); z = zeros(size(x)); col = x; % This is ...

15 years ago | 36

| accepted

Answered
rectangular basis function/ rectangular pulse
Your description is a little unclear. Here is a function which will do something similar to what your first sentence asks. ...

15 years ago | 0

Load more