Answered
Circshift not working for values of zero.
x_2=circshift(x,[0 -1])

12 years ago | 0

Answered
how to construct the matrix of 10x1000
out=meshgrid(repmat(1:10,1,100),1:10)

12 years ago | 0

Answered
Clear all fields of a struct
%example a.b=1 a.c=2 a.d=3 %---------------- f=fields(a) for k=1:numel(f) a.(f{k})=[]; end

12 years ago | 0

Answered
How to create a matrix containing the diagonal matrix of another one?
*EDIT* A=[1 2 0 0 0 0; 3 4 0 0 0 0; 0 0 5 6 0 0; 0 0 7 8 0 0;0 0 0 0 9 10; 0 0 0 0 11 12] [n,m]=size(A); %----------pn an...

12 years ago | 0

| accepted

Answered
I can't plot transfer functions higher than 3. order with command "bode"!
s=tf('s'); p=(s+1)*(s+2)/((s+3)*(s+4)*(s+5)); bode(p);

12 years ago | 0

Answered
how can i read a certain value / signal inside a simulink model or stateflow?
You can use a to workspace block

12 years ago | 0

| accepted

Answered
How to convert one cell matrix into multiple cell
reshape(A,3120,32) In your case it should be reshape(A,6240,32)

12 years ago | 0

Answered
how can i link a block to a library?
<http://www.mathworks.com/help/simulink/ug/creating-block-libraries.html>

12 years ago | 0

Answered
where can i get it2fis
<http://www.mathworks.com/matlabcentral/fileexchange/29006-functions-for-interval-type-2-fuzzy-logic-systems/content/IT2FLS/IT2F...

12 years ago | 0

Answered
How do I divide my y axis into sections / exclude a region of the y axis from plotting?
x=0:.1:10; y=1.01*sin(x) [ax,h1,h2]=plotyy(x,y,x,y) set(ax(1),'ylim',[0.99 1.01]) set(ax(2),'ylim',[-1.01 -0.99])

12 years ago | 0

Answered
Using loops for simulation in Simulink
add a unit delay block to your simulink model just after the calculation of A, you can set the initial value of this block.

12 years ago | 0

| accepted

Answered
Extracting the first contiguous values without looping
A = [ 1 1 0 0 1 1; 0 0 1 1 1 0; 1 0 1 1 0 0; 0 0 1 1 1 1] B=diff(A,[],2) [n,m]=size(A); idx=...

12 years ago | 1

| accepted

Answered
Export Bode Plot Data to Excel or text file
I don't know how you get a bode plot, if like below: % N=1; % D=[1 10]; [a,p,w]=bode(N,D) subplot(2,1,1) plot(log10(w),...

12 years ago | 0

Answered
Vector manipulation by changing order or numbers in a vector.
*Edit* a = [4 5 7 8 9 10] b=circshift(a,[0 -1])

12 years ago | 1

| accepted

Answered
Calculating the distance between points using vectorization.
points = [2 5; 6 9; 7 8; 9 10; 6 10] for k=1:size(points,1)-1 p1=points(k,:); p2=points(k+1:end,:); a=...

12 years ago | 2

Answered
Get a user to input corordinates to form a matrix.
You can try this x=input('enter x coordinates between square bracket, like [1 2 3] ') y=input('enter y coordinates between...

12 years ago | 1

| accepted

Answered
Returning index values (elements) of a randomly generated matrix (using ceil command) in Matlab
matrix_ones =matrix_nodes(matrix_nodes==1) matrix_zeros = matrix_nodes(matrix_nodes==0)

12 years ago | 1

| accepted

Answered
Write a number and value to the same cell in excel?
*EDIT* n = 1.25 % user desired value A = {sprintf('%d gram \n',n)} xlswrite('MP_D.xls',A)

12 years ago | 0

| accepted

Answered
Position of max value of each column in a matrix
A = [1,4,9; 2,8,7; 3,4,5]; [~,ii]=max(A); m=ii n=1:size(A,2)

12 years ago | 1

Answered
Selected multiple values from a matrix
q = [a c]; p = [b d]; idx=sub2ind(size(M),q,p); out=M(idx)

12 years ago | 8

| accepted

Answered
Finding distance between one fixed point and a range of points.
%-------------Example---------------------- v=rand(10,2); n=rand(1,2); scatter(v(:,1),v(:,2)) hold on scatter(n(1),n(2)...

12 years ago | 0

Answered
Learning ordinary differential equations using Matlab
Look at this help <http://www.mathworks.com/help/matlab/ref/ode45.html>

12 years ago | 0

Answered
plot title and label
Change the order figure(1) plot(theta,P) title('Engine Pressure') xlabel('theta') ylabel('Pressure')

12 years ago | 0

| accepted

Answered
How can i plot zero and its frequency responsE
The numerator should be a = 0.0686 To find poles and zeros [z,p,K] = tf2zp(a,c); % not tf2zp(c,a) *Add* ...

12 years ago | 0

| accepted

Answered
create subarray from an given array
*EDIT* a=[1 2 3 4 5 6 7 8 9] n=numel(a) % find divisor of a c=1:n d = c(rem(n,c)==0) % number of groupes ng=d(r...

12 years ago | 0

Answered
zeros(8,m,n) for a 3d image, what does 8 specify here?.
Look at <http://www.mathworks.com/products/matlab/examples.html?file=/products/demos/shipping/matlab/nddemo.html#1>

12 years ago | 0

Answered
User Defined Functions and Excel Link
you can use both

12 years ago | 0

| accepted

Answered
Plotyy y-axis ticks/label issues
add set(AX(2),'ytick',linspace(min(uA),max(uA),5));

12 years ago | 0

| accepted

Answered
I didn't understand the output of "y=sin(2*pi*t)" where t=[1 2 3 4 5].
2*pi is not stored exactly as 2*pi, but stored with some error

12 years ago | 0

Load more