Answered
adding varied length vectors to a new matrix sequentially
for k=1:10 vec=randi(10,1,randi(10),1) % your vector out{k}=vec end

13 years ago | 1

Answered
Delete double cell array entries
CellArray={[1 2 3] [1 2] [3 5 6 7] [1 2] [2 4] }; m=max(cellfun(@numel,CellArray)); v=cellfun(@(x) [x inf(1,m-numel(x))],Ce...

13 years ago | 0

| accepted

Answered
How do I use regexprep to replace final NaN values in a matrix?
A=[NaN NaN NaN 100 102 101 99 102 NaN NaN NaN NaN NaN 101 103 NaN NaN] A(diff(isnan([A 0]))==-1)=0

13 years ago | 1

Answered
Global variables in embedded Matlab function
You can pass your constant through a <http://www.mathworks.com/help/simulink/slref/constant.html constant> block,

13 years ago | 0

Answered
How to display continuous changing values in static text of GUI
Change the last condition if count==3 str=get(handles.text1,'string') set(handles.text1,'string',[str da]); ...

13 years ago | 0

Answered
??? Cell contents reference from a non-cell array object.
If y is your cell array causing the error, add at the beginning of your code clear y in your case clear four_neighb...

13 years ago | 0

Answered
Adding elements of arrays conditionally
Try this [xx1 yy1]=meshgrid(x1,y1); [xx2 yy2]=meshgrid(x2,y2); for k=1:10 for p=1:10 [n,~]=find(xx2==xx1(k,...

13 years ago | 0

Answered
Adding elements of arrays conditionally
*EDIR* [xx1 yy1]=meshgrid(x1,y1); [xx2 yy2]=meshgrid(x2,y2); for k=1:10 for p=1:10 idx=find(xx2==xx1(k,p)...

13 years ago | 0

Answered
2nd x-axis on plotyy
set(AX(2),'XaxisLocation','top','xlim',[0 100])

13 years ago | 1

Answered
Using a signal to create a variable
A = [-1 1 0.5 0.2 -0.7] B = [1.05 1.05 1.05 1.05 1.03] C = [0.99 1.01 0.76 1.89 1.23] D=C idx=A<0 D(idx)=B(idx)

13 years ago | 0

Answered
How to use xlswrite
jj=0 for i=15:imax for j=20:jmax for k=25:kmax jj=jj+1 b= function (i,j,k) ...

13 years ago | 1

Answered
PID block library location
The PID block is in simulink/continuous. That depends also on the version of your Matlab

13 years ago | 0

Answered
What is the minimum number greater than zero in matlab?
n = realmin

13 years ago | 0

Answered
Look and extract numbers within a range in MATLAB
A=[2,2345,111;2,2344,3000;4,2345,200;4,2000,200; 2,2346,22; 4,2111,1; 4,3111,1] B=[2,2345,112;2,2344,3110;4,2345,192;4,2000,1...

13 years ago | 0

| accepted

Answered
Help needed on Date Strings.....
dates=datenum('14/Mar/2012'):datenum('15/Mar/2013')

13 years ago | 0

Answered
how can we convert c++ code into matlab code?
you can not convert c++ code to Matlab code. but it's possible to use this c++ code in Matlab by using <http://www.mathworks.co...

13 years ago | 0

| accepted

Answered
how can we give freqency to sin wave block in radians
If your frequency in Hz is 50 enter 50*2*pi

13 years ago | 0

Answered
sum of a series
a0=1; a1=2; a2=1; y=rand(1,1000) % your data coeff=[-a2 -a1 1]; for ii = 3:1000 v(ii) =sum(y(ii-2:ii).* coeff)-a0; ...

13 years ago | 1

| accepted

Answered
How do I name elements in a field of a structure?
A=struct('a',rand(33,2),'b',1,'c',2,'d',3) % your struct array v=A.a B.b=A.b B.c=A.c B.d=A.d m=0 for k=1:33 for p=...

13 years ago | 0

| accepted

Answered
How to show symbolic equation answer in GUI controllers like static text
Use <http://www.mathworks.com/help/matlab/ref/guidata.html guidata>

13 years ago | 0

Answered
vectorize without using loop
out=X(indtrn,indtrn)

13 years ago | 0

| accepted

Answered
Extracting rows with specific condition in MATLAB
A=[2,2345,1; 2,2344,0; 4, 2345,56 ; 4,2000,1; 2,2346,22; 4,2111,1] B=[2,2346,22; 2,2344,0; 4, 2314,56 ; 4,2111,1] C=A(~ism...

13 years ago | 0

| accepted

Answered
Multiple anonymous functions combined
You should pass E through input argument of your function Example function y=yfcn(a,b,f) y=f(a,b)+500 Then call your...

13 years ago | 0

Answered
Separately creating two parts of an array?
x(n+1:end)

13 years ago | 0

Answered
loop through a column and display the number of elements until the same value occcurs
This gives the number of element between two consecutive same numbers. *EDIT* A=[1 2 3 4 5 7 9 2 1 1 5 6 8 9 2 4 5 6]' ...

13 years ago | 0

| accepted

Answered
How can I generate signals with in Maltab?
Use <http://www.mathworks.com/help/ident/ref/idinput.html idinput> <http://www.mathworks.com/help/control/ref/gensig.html ...

13 years ago | 0

Answered
loop through a column and display the number of elements until the same value occcurs
A=[1 2 3 4 5 7 9 2 1 5 6 8 9 2 4 5 6]' for k=1:numel(A) B=A(k:end) idx=find(B==B(1)) n=numel(idx) if n==1...

13 years ago | 0

Answered
Convert column of data from cumulative to relative values
test=[1 1 1 1 1 2 2 2 3 3 3 3 3 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14]' idx=diff([0; find([diff(test(:,1)); 1])]) new_t...

13 years ago | 0

| accepted

Answered
Panel not becoming visible
Maybe panel3 is inside panel1

13 years ago | 1

| accepted

Answered
imwrite plots not saving
If you want to save a plot use <http://www.mathworks.com/help/matlab/ref/saveas.html saveas>

13 years ago | 1

Load more