Respondida
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(...

alrededor de 15 años hace | 0

| aceptada

Respondida
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');...

alrededor de 15 años hace | 1

| aceptada

Respondida
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)';

alrededor de 15 años hace | 2

| aceptada

Respondida
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 ...

alrededor de 15 años hace | 0

Respondida
Vector
.^ instead of ^

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 0

Respondida
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:...

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 0

Respondida
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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

| aceptada

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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 1

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

| aceptada

Respondida
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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 8

| aceptada

Respondida
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); ...

alrededor de 15 años hace | 0

Respondida
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.

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

Respondida
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

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 1

| aceptada

Respondida
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?

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 2

Respondida
Implementing Cramer's method in MATLAB
I wonder how so many teachers give assignments to be solved in MATLAB without first teaching the MATLAB basics! <http://www...

alrededor de 15 años hace | 0

Cargar más