Answered
How to plot the frequency spectrum of a signal on Matlab?
The frequency of your signal is |F=1 Hz|, Then why |t = 0:1/Fs:7501| I suggest t = 0:1/Fs:1-1/Fs

14 years ago | 0

Answered
How can I retrieve a .mat file content (e.g. arrays or matrix)?
In Matlab comman type data=load('yourfilename') What did you get?

14 years ago | 0

Answered
is not equal in cellarray
when the condition is true : levelxxx(i,:)=[]; then the size of levelxxx will be reduced! use v_temp=levelxxx...

14 years ago | 0

Answered
How can I pass variable from GUI to matlab workspace?
don't use semicolon *;* y=5

14 years ago | 3

| accepted

Answered
how to create a sine wave between two sine references
%try this close f1=50; f2=300; t=0:0.0001:4/f1; y1=-0.5*sin(2*pi*f1*t); y2=sin(2*pi*f1*t); yy=sin(2*pi*f2*t); idx2...

14 years ago | 0

Answered
set parameter value from mfile
You must stop or pause simultion before seting new parameters

14 years ago | 0

Answered
Ploting A square around minima of a matrix
a=1; % square dimension mat=rand(5) [c,idx]=min(mat(:)) [ii,jj]=ind2sub([5 5],idx) x=[ii-a/2 ii+a/2 ii+a/2 ii-a/2 ii-a/2];...

14 years ago | 0

Answered
Error with noninteger numbers
you can't use x(0.5) or x(-1) the index must be a positive integer or logical m = zeros(25,2); k1=0; for n = 0....

14 years ago | 0

Answered
Help with "Make error" in simulink
have you chosen your compiler by mex -setup

14 years ago | 1

| accepted

Answered
create an array contain no of string adding one by one
A={'Hi','I','am','ABCD'}

14 years ago | 0

Answered
Data with names through a loop in vector?
If your data are saved in a mat file data=load('yourfile') for k=1:1000 out(k)=data.(sprintf('z%d',k)) end

14 years ago | 0

| accepted

Answered
How can I sum a matrix in a For Loop?
z=0; stream=[2 3 4 5 4 5 6 7]; y=[1 2 3 4; 2 3 4 5 ; 1 2 3 4;1 2 3 4; 3 4 5 6]; for t=0:10 U=stream(randi(length(str...

14 years ago | 1

| accepted

Answered
How do I plot this simple function in matlab
x=rand(100,1) % eg y=fft(x) plot(abs(y)) why real(y)?

14 years ago | 0

Answered
How can I sum a matrix in a For Loop?
eg res=0 for k=1:5 M=rand(4); res=bsxfun(@plus,res,M) end

14 years ago | 1

Answered
Undefined function or method 'decimate' for input type 'double'
Have you a *signal processing* toolbox? check it in Matlab command with ver

14 years ago | 0

Answered
This is my program... i have this error ??? Subscript indices must either be real positive integers or logicals. how can i fix it?
Your are using *sum* as a variable and as a function maybe this is what you want x=rand(78336,2); % your data l=size(x...

14 years ago | 0

Answered
Problems with time travel. A (t)=Variable(t-2)
eg y=[0 rand(1,20)] use y(max(1,n-n0))

14 years ago | 0

Answered
Find the number of digits after the decimal point in a number, please help!
x=11.111 x = abs(x); %in case of negative numbers n=0 while (floor(x*10^n)~=x*10^n) n=n+1 end

14 years ago | 3

| accepted

Answered
Mean of some element in Array
A=rand(8501,1); %your data B=mean(reshape(A(1:8500),10,[])) with the for loop ii=1; A=rand(8501,1) for k=1:10:...

14 years ago | 1

| accepted

Answered
Split 132*63 by 2 or 3 for avoid complication
A= [5 7 8 6 6 4; 5 4 7 9 4 2; 9 9 7 5 3 3; 6 4 3 7 3 3]; B=A([1 3],[1 3 4 6]) for your second example, you did'nt explai...

14 years ago | 0

Answered
gain information from a .cnv file
fid = fopen('yourfile.cnv'); line1 = fgetl(fid); res=line1; while ischar(line1) line1 = fgetl(fid); res =char(res,lin...

14 years ago | 0

| accepted

Answered
find repeated columns of a matrix
A=repmat(rand(8,5),1,100/5) A=A(:,randperm(100)) % your matrix col1=A(:,1) idx=find(~any(bsxfun(@minus, A,col1)))

14 years ago | 1

| accepted

Answered
Substitute an array of number for a symbolic variable
syms x y f=x^3+y^3+3*x^2+2*y^2+9 fx=diff(f,x) x=[1,2,3,4,5] y=[6,7,8,9,10] eval(f) eval(fx)

14 years ago | 4

Answered
Using Multiple X- and Y-Axes Command Axis Label
figure (9) ax1 = gca; hl1 = line(x1,y1,'Color','r'); set(ax1,'XColor','r','YColor','r') ax2 = axes('Position',get(ax1,'Pos...

14 years ago | 0

| accepted

Answered
how can i run simulink block since am using matlab r2012a
In Matlab command run this mex -setup then choose your compiler

14 years ago | 1

Answered
How to model a delay element in matlab
close n=1:10 yn=rand(1,numel(n)) % your signal plot(yn,'-og') n0=4 yn0=[zeros(1,n0-1) yn] % your delayed signal hold...

14 years ago | 1

| accepted

Answered
i have an value as 6.5.give me the syntax to get the whole number 6
a=6.5 fix (a) % for other rounding look at *round*, *ceil* command

14 years ago | 1

| accepted

Answered
how to sort matrix according to another matrix in matlab
sort(A,2) gives the result but had nothing to do with B maybe you want this C=sort(A,2) C=C(:,B)

14 years ago | 0

| accepted

Answered
How to read mix characters in a cell, and write to another cell?
v={'r1200i000-0ln140010.LID' 'r1200i100-4ln140030.LID' 'r1200i100-8ln140010.LID' 'r1225i100-8ln140030.LID'} out=cellfun(@(...

14 years ago | 0

| accepted

Load more