Answered
legend plotting help with for loop
Something similar to this: hold on mark = {'*-r','o-g','^-b','*-k','*-c','*-r'}; for i = 1 : 6 %loads intern...

14 years ago | 0

Answered
create array
a=zeros(3,6624); for b=1:size(a,2) c(1)=rand/3; c(2)=rand/3; c(3)=1-c(1)-c(2); cr=randperm(3); a(:,b)=[c(cr(1));c(...

14 years ago | 0

| accepted

Answered
fprinf format
x=[1,2,3] y=[4,5,6] z=[7,8,9] FileName='results'; FID = fopen(FileName, 'w'); if FID < 0, error('Cannot open file');...

14 years ago | 1

| accepted

Answered
Any idea on how to create a n by n square matrix.
v=1:npanels; C=reshape(cell2mat(arrayfun(@(v)(y(v).*dP)./((x(v)-P).^2+(y(v).^2)),... v,'uni',false)),npanels,npanels)';

14 years ago | 2

| accepted

Answered
What does this print out?
it never prints, the condition is false do this before the loop b<a %replacing b and a by their first values you get 3<1 ...

14 years ago | 0

Answered
Vector
.^ instead of ^

14 years ago | 1

| accepted

Answered
save variables gui
Make sure that YourFigureNumber is really one handle to a figure, figure1 usually works to specify the GUI figure handle.

14 years ago | 0

Answered
Count the frequency of a number in a series of numbers.
doc histc example a=[1 2 3 4 5 6 1 2 6 6 6]; [n,bin]=histc(a,1:6); n is the frequency and bin is the number example:...

14 years ago | 0

Answered
Solving a math problem with two unknowns using matlab (linear least square/optimization)
I=[-7.02 -7.84 -6.27 -7.33]; D=[-49.600 -0.2213 -68.809 -0.2213 -63.307 -0.1510 -65.438 -0.1468]; s=D...

14 years ago | 0

Answered
random pick cell array
x=[1;8;9;10;16]; %is one array not cell array x(randi([1 numel(x)])) %show one random element of the array

14 years ago | 0

Answered
Passing datenum a column vector?
d=[19961016 19961017 19961018 19961021 19961022 19961023 19961024]; d=num2str(d)-0; Y=str2num(char...

14 years ago | 0

| accepted

Answered
Help! About use symsum on matrix
Your are missing a dot before the exponent rt=symsum((p.^t)*yu,t,0,m);

14 years ago | 0

Answered
Indexing
I0=find(x==0) I30=find(x==-30)

14 years ago | 1

| accepted

Answered
unable to plot
If MATLAB doesn't throw out errors when running that code that's because you are loading something correctly, please look at the...

15 years ago | 0

Answered
load multiple files in a loop
for i = 1 : k(1) variable(i) = load(sprintf('internalforce_%d',i)) end

15 years ago | 0

| accepted

Answered
concatenate structs in a loop
for n=1:size(A,1) s{n}=cat(2,A(n,1).B, A(n,2).B, A(n,3).B, A(n,4).B, A(n,5).B, A(n,6).B, A(n,7).B); end

15 years ago | 0

Answered
Add standalone executable to windows programs menu on installation
<http://www.jrsoftware.org/isinfo.php Inno Setup>

15 years ago | 0

Answered
Save disp output as a string/cell variable
MyVariable=evalc('disp(MyThingToShow)')

15 years ago | 8

| accepted

Answered
Sort a matrix without using the sort function
[row,column]=size(a); for nc=1:column for nr=1:row [C,I]=max(a(nr:row,nc)); b=a(nr,nc); ...

15 years ago | 0

Answered
Is there a way to uninstall standalone executables after installing them on a user's computer?
It's not one regular installation, the files are all contained in the same folder so just delete them.

15 years ago | 0

Answered
i need to read matrix from a png file
for ni=1:3 I{ni}= imread(sprintf('image%s.png',num2str(ni))); end limit=-1; while (limit<0) | (limit>50) disp...

15 years ago | 0

Answered
Plotting ECG signals
doc fft %the documentation example is very good <http://stackoverflow.com/questions/1773542/matlab-filter-noisy-ekg-signal Go...

15 years ago | 0

| accepted

Answered
while loop, user-defined function, to find prime numbers
Vectorized versions: function pr=prime(n) %just makes a vector with all prime numbers from 1 to n %no error check, I leav...

15 years ago | 0

Answered
Find max of matrix without using built in function.
mx=a(1); for p=2:numel(a) if a(p)>mx mx=a(p); end end mx %the maximum value

15 years ago | 1

| accepted

Answered
Opening default browser
system('start www.google.com')

15 years ago | 1

| accepted

Answered
Use elseif inside a case switch. What is Wrong with my code? Only the first "if" case only works none of the elseif work?? Please any advice would help.
This condition elseif 7<rp<=27; is valid for rp=27 so why do you have this one elseif rp==27; after it?

15 years ago | 0

Answered
what does this code mean?
. before operation means that the operation is element wise [a b].*[c d]=[a*c b*d] ' means transpose (columns turn into rows a...

15 years ago | 0

| accepted

Answered
Callback and evalin
The evalin is evaluating the argument X in the workspace but X only exists in your current function, try like this evalin('ba...

15 years ago | 0

Answered
about ztrans command?
ztrans is a function from the Symbolic Math Toolbox™, you must have that toolbox installed and with a valid licence.

15 years ago | 0

Answered
Matlab gives me a formula when i want a value
eval(Wi)

15 years ago | 2

Load more