Answered
want to calculate the sum of the numbers appear in an array that is mix of NaNs and numbers
A=[NaN NaN NaN 1 2 3 NaN NaN NaN 4 5 6 10 NaN NaN 2 NaN NaN 1 2 0 4] idx=find(~isnan(A)) id=[1 diff(idx)] ii=[1 find(id>1)]...

13 years ago | 0

Answered
How can I create index for a word in legend?
legend(' Gamma_x_z')

13 years ago | 2

Answered
Wrong matrix multiplication answer
I think you are doing something wrong by hand. The result 6 -12 3 16 5 11 9 12 0 is c...

13 years ago | 3

| accepted

Answered
Multi Dimensional Cell Array
cellarray={A1,A2,A3,A4,AA1,AA2,AA3,AA4,BB1,BB2,BB3,BB4}

13 years ago | 0

Answered
How to make loglog subplots?
set(gca,'xscale','log')

13 years ago | 3

| accepted

Answered
find nonzero-middle point of an array
idx=find(a); out=a(idx(round(numel(idx)/2)))

13 years ago | 1

| accepted

Answered
combined operations on struct arrays
S=struct('a',cellfun(@plus, {S.a},{5 6 7},'un',0))

13 years ago | 0

Answered
Access the txt file for a simulink model
Use <http://www.mathworks.com/help/simulink/slref/add_line.html add_line> and delete_line

13 years ago | 0

Answered
MATLAB attempted to access x(1,3), index out of bounds because numel(x)=1.
Because you set x to 0, which means its length is 1, you can not use x(i,1) with i>1

13 years ago | 0

Answered
I would like to get the specific number
syms b G = 7340; G1 = 4516.881; M1 = 5222.328; M2 = 3264.034; P1 = 3000; P2 = 10000; out=solve(G1 == G*(P1*exp(-b*M1/...

13 years ago | 1

Answered
How can I quickly pass the output of a Simulink block to a GUI?
get_param allows to read block parameters, the block output is not a parameter

13 years ago | 0

Answered
How can I store index number and value from a for loop and a problem with optimization
for i = 1:3 tmp(i) = rand; dummy(i,:) =abs(tmp(i) - cumsum_pdf_x); [val1 ind1] = min(dummy(i,:)); val(i)=v...

13 years ago | 0

Answered
How do i use vectors as input to the "interpreted Matlab Fnc" block?
a should be [2 2] instead of [2;2]

13 years ago | 0

| accepted

Answered
Investing of a string/function and listing of variables
y=input('enter y','s') y=sym(y) [coefficient,var]=coeffs(y) %you should enter y like below 12*x1+14*x2

13 years ago | 0

Answered
Plotting few lines using one matrix
plot(x(1:3),y(1:3)) hold all plot(x(4:5),y(4:5))

13 years ago | 0

| accepted

Answered
how to set the figure width
figure set(gcf,'paperunits','inches') set(gcf,'position',[0 0 3 3]) saveas(gcf,'fig1.png')

13 years ago | 0

| accepted

Answered
Using the answer of inputdlg into a Matlab Expression
Use Source = char(Source)

13 years ago | 0

Answered
help defining a square wave
t= linspace(0,0.03,1000); period=0.03/10 I=10 i_block = 0; for k = 1:1000 t(k) if t(k) >= 0.01 i_...

13 years ago | 0

| accepted

Answered
how to find the index of first n occurrence of each unique value of a matrix
A=randi(42,5915,1); b=cell2mat(arrayfun(@(x) find(A==x,75),1:42,'un',0))'

13 years ago | 1

| accepted

Answered
How to get my script to work?
A = [1 2;3 4] %Investigate the iterative procedure v(n+1) = u/C for n = 1:10 v(1,:) = [1 0]; u = A*transpose(v(n,:...

13 years ago | 0

Answered
Solving equations in Matlab
It's not arccosh, It's acosh

13 years ago | 1

| accepted

Answered
Define an array with variable
k=4 assignin('base',sprintf('x_%d',k),[1 2 3])

13 years ago | 0

Answered
Error using == matrix dimensions must agree
Use If isequal(unit,'cm')

13 years ago | 0

Answered
Plot a figure as time progresses?
t=0:0.1:10; x=t.^2; figure; hold on xlim([min(t) max(t)]) ylim([min(x) max(x)]) for k=1:numel(t) plot(t(k),x(k)...

13 years ago | 0

| accepted

Answered
frequency relay function for Zeigler nichols 2?
Maybe you mean a <http://www.mathworks.com/help/simulink/slref/transportdelay.html delay> block

13 years ago | 0

Answered
how can i split a speech signal into 3 equal parts??
x=[1 2 3 4 5 6 7 8] n=round(numel(x)/2) x1=x(1:n) x2=x(n+1:end)

13 years ago | 0

Answered
How to generate k unique random numbers from 1 to n in matlab 2009
[idx,idx]=sort(rand(1,n)); out=idx(1:k)

13 years ago | 1

| accepted

Load more