Answered
What should be the plot command?
Read the documentation about plot doc plot Look at this example t=0:0.01:10 y1=sin(t) y2=cos(t) plot(t,y1,t,y2)...

12 years ago | 0

Answered
change values in a matrix
idx=A<=-1 A(idx)=A(idx)-fix(A(idx))

12 years ago | 1

Answered
how to loop it
Use the multiplication element by element .* z=x.*y x_new=x.*cosd(y) y_new=y.*sind(y)

12 years ago | 0

| accepted

Answered
Change scale of intensity histogram
Maybe you want : ylim([min_value max_value])

12 years ago | 0

| accepted

Answered
Error: File: box.m Line: 23 Column: 21 Unbalanced or unexpected parenthesis or bracket.
You missed a multiplication operator * in (line 23) Y = [a*b*c-181;2(a*b+a*c+b*c);a^2+b^2+c^2]; It should be Y = [a...

12 years ago | 0

| accepted

Answered
how to sort rows
M={'(1,A1)' '(1,B1)' '(1,C1)' '(1,A2)' '(1,B2)' '(1,C2)' '(1,A3)' '(1,B3)' '(1,C3)'} %M='(1,A1)' c1=cellfun(@(x) x{1...

12 years ago | 0

Answered
Find at least 4 consecutive values less than 1 in an array
*Edit* M= [1 0 .3 .5 .2 .1 6 7 .3 .5 10 1 .8 .9 .7 .2 .1 .3] if diff(size(M))<0 M=M' end a=M<1; b=strrep(num2str(...

12 years ago | 0

Answered
Find at least 4 consecutive values less than 1 in an array
*Edit* M= [1 0 .3 .5 .2 .1 6 7 .3 .5 10 1 .8 .9 .7 .2 .1 .3]; if diff(size(M))<0 M=M' end a=[0 M<1 0]; ii=strfind(a...

12 years ago | 0

Answered
can we use multitasking on matlab
You will need <http://www.mathworks.com/products/parallel-computing/ parallel-computing Tool box>

12 years ago | 0

Answered
Why is this script so slow and how can i make it faster?
Without sortrows. This is much faster M1=permute(M,[3 2 1]); idx=find(M1<0.5); [ii,jj,kk]=ind2sub(size(M1),idx); x=kk'...

12 years ago | 0

Answered
How remove plateaus on plot?
t=1:numel(y) d=abs(gradient(y,t)) y(d<0.4)=[]; plot(y)

12 years ago | 1

| accepted

Answered
Matrix operation with equation
If X' is the transpose of X, the only way that X and X' are the same size is when X is a square matrix

12 years ago | 0

Answered
what is assignment error in the following code?
% The expression |outage_f(j)=(pout1(j,:)+sum(pout1(j,N-k+1:N))+ pout3)/N;| becomes outage_f(j,:)=(pout2(j,:)+sum(pout2...

12 years ago | 1

Answered
Why is this script so slow and how can i make it faster?
idx=find(M<0.5); [ii,jj,kk]=ind2sub(size(M),idx); [a,idx1]=sortrows([ii jj kk],[1 2 3]); x=a(:,1)'; y=a(:,2)'; z=a(:,3)';...

12 years ago | 0

Answered
need function to compute iterations of element in matrix
A=[1 2 3;3 0 1;4 5 6;3 1 5] n1=sum(A(:,1)==3) % number of 3 in the first column n2=sum(A(:,3)==3) % number of 3 in the third...

12 years ago | 2

Answered
How to find minimum and maximum values?
C=max(A,B) D=min(A,B)

12 years ago | 1

| accepted

Answered
can't use dlmread with % delimiter, need another function, help
b=importdata('file.txt','%%')

12 years ago | 0

Answered
How to find the mean of data contained in a column of a table?
A=[1 11; 2 22;3 33;4 44;5 55] out=mean(A)

12 years ago | 0

Answered
store all array values in a field to a variable
v=struct('a',num2cell(1:10)','f',num2cell(rand(2,10),1)') out=reshape([v.f],2,10)'

12 years ago | 0

Answered
use imcontrast while dlginput is open
You can work with a <http://www.mathworks.com/discovery/matlab-gui.html Matlab Gui>

12 years ago | 0

Answered
How to separate numbers and text from a string
s = 'x 5.67 y 7.789' out=str2double(regexp(s,'[\d.]+','match'))

12 years ago | 4

| accepted

Answered
Using a cell array and a for loop
There are many errors in your code: Why nested loop? you are using display function 30 times! |i=1:5 and j=1:5| , you wi...

12 years ago | 0

Answered
matrix change affect other matrix
B=[ 4 5 6 6 3 8 4 8 7 3 5 3] idx1=B==7; idx2=B==3; B(idx1)=3; B(idx2)=7;

12 years ago | 0

| accepted

Answered
Solve second order differential equation with independent variable
Your function should be: function dz=myode45(x,z) dz(1,1)=z(2) dz(2,1)=-2*z(2)/x+10*z(1)/(z(1)+1) %Call myode45 t...

12 years ago | 0

Answered
How does this matlab function works?
This is not true %-----------------model without delay----------- A=[-11 1;-10 0];B=[0;1];C=[1 0];D=0; ss_model1=ss...

12 years ago | 0

| accepted

Answered
How to convert 10x10 matrix to X, Y, Z txt file
If A is your matrix A=[1 1 1; 1 2 2; 1 3 3; 1 4 4; 1 5 5; 2 1 1; 2 2 2; 2 3 3;5 5 5] dlmwrite('file_name.txt',A,'delim...

12 years ago | 0

Answered
Create an m-script file to plot the following functions separately
x=0:30; plot(x,x.^3+2*x.^2-6*x) grid xlabel('x') ylabel('y') title('y=x.^3+2*x.^2-6*x') For more details look at ...

12 years ago | 2

| accepted

Answered
Replace matrix with the other random matrix.
Maybe you want this: a=randi([0 1],1,10); s=rng; b=rand(1,10); out=a.*b

12 years ago | 0

Answered
Error: Not Enough Input Arguments.
I don't know if you have done this code or find it somewhere. This code represent a function, but at the same time the input arg...

12 years ago | 0

Answered
Append rows at the end of Matrix
a = [1 2 3 ; 4 5 6; 7 8 9]; b=[5 5 5] c=[a;b]% add one row c=[a;repmat(b,7,1)] %add 7rows

12 years ago | 15

| accepted

Load more