Answered
Rotating array with 20 degree
Look at this example % -----initial curve--------- x=1:0.01:10; y=sin(x); plot(x,y,'r') hold on %---------rotated curv...

13 years ago | 1

| accepted

Answered
Calculating total number of lines in a file opened in MATLAB
fid = fopen('filename.txt'); res={}; while ~feof(fid) res{end+1,1} =fgetl(fid); end fclose(fid); number_of_lines=num...

13 years ago | 2

| accepted

Answered
Xlswrite, problem. How to resolve
Look at this example a=rand(4,2); b=rand(10,5); % a and b should have, at least the same number of columns aa=cell(4,5...

13 years ago | 0

Answered
normalize a vector of points belonging to the interval [a,b]
a=10; b=20; v=rand(1,10)*5+1 n_data = a+(b-a)*(v-min(v))/( max(v)-min(v))

13 years ago | 2

Answered
How to genrate a sequence of image from a single image of size 256X256
If Im is your image Im1=Im(100:150,120:200) % for example imshow(Im1)

13 years ago | 0

Answered
How do I generate K samples of size n from a multivariate normal?
mux = [3;4;0.5]; sigma = [1 0.2 0.7;0.2 1 0.5;0.7 0.5 1]; R=cell(5000,1); for k=1:5000 R{k} = mvnrnd(mux,sigma,40);...

13 years ago | 0

| accepted

Answered
Finding maximums in matrix columns
*Edit* n=2; % first column m=7 % last column c1=Matrix(:,n); c2=Matrix(:,m); k=1; max_val=[]; idx_val=[]; index=[]; ...

13 years ago | 0

Answered
I need help writing a function that checks if a number is even or odd in Matlab.
You can use mod function mod(yournumber,2)

13 years ago | 2

| accepted

Answered
how to write a changing title in a loop
function data=coa08xxx_lines(n) data=load('xydata'); data=load('xydata'); y=data.Y; u=data.X; ii=ceil(n/3); jj=ceil(n/i...

13 years ago | 7

| accepted

Answered
How to get 'type' of a variable in matlab?
class(your_variable)

13 years ago | 6

Answered
Breaking up matrix by values in column
c=matrix(:,end) ; out=matrix(c>=2 & c<=4,:)

13 years ago | 0

| accepted

Answered
Indexing Cell Array created by RegExp, sorting file names
Maybe you want getrest = regexp(names,'resting_ABC_\d+.dat','match'); files=cellfun(@(x) x{1},getrest(~cellfun('isempty',...

13 years ago | 0

Answered
Plotting two(function) curve in same figure?how?
plot(x,y1) hold on plot(x,y2) %or plot(x,y1,x,y2) %or plotyy(x,y1,x,y2)

13 years ago | 1

| accepted

Answered
Put 3 columns of two matrix in 1 row matrix
X=[1 2 3;4 5 6]; Y=[11 22 33;44 55 66] X=X'; Y=Y'; a=[X(:) Y(:)]' out=a(:)'

13 years ago | 0

| accepted

Answered
how to represent the roots of a polynomial on a graph?
p=[1 2 3 4 5]; % your polynomial x^4+2x^3+3x^2+4x+5 r=roots(p) scatter(real(r),imag(r),'filled','red')

13 years ago | 0

| accepted

Answered
Not enough input arguments.
You have to use multiplication element by element .* instead of * function outpoint = aff_mni2tal(inpoint) Tfrm = [0.88 0...

13 years ago | 0

Answered
HELP: 'Error: Function definitions are not permitted in this context.'
If a,b,u,df,dr and Fn are used by your function, you need to define them inside your function, or define them as input arguments...

13 years ago | 0

| accepted

Answered
How can I plot multiple signals with unit step signal
t=-5:0.1:5 v=(2*t+1).*(heaviside(t)-heaviside(t-1))+3*(heaviside(t-1)-heaviside(t-2))+(-t+3).*(heaviside(t-2)-heaviside(t-3))...

13 years ago | 1

| accepted

Answered
Set legend color in stacked bar plot
close myC= [0 0 1 1 0 0 1 0.4 0 0 0.8 1 0.6 0 1 0 1 0 ]; data2D = rand(10,6); H=bar(data2D, 'stack...

13 years ago | 8

| accepted

Answered
creating variable of specified length and same values
a=1.2; a=a(ones(1,4)) %or a=repmat(1.2,1,4)

13 years ago | 0

Answered
i need to plot many plots in a loop function.
function data=coa08xxx_lines(n) load xydata ii=ceil(n/3); jj=ceil(n/ii); for k=1:n subplot(ii,jj,k) plot(u(:,k)...

13 years ago | 1

| accepted

Answered
How to order values within a cell array more efficiently??
[~,~,idx]=unique(ratings(1,:)); out=ratings(3,idx) *ADD* If the second row is not sorted [idx2,idx2]=sort(rating...

13 years ago | 1

Answered
How to order values within a cell array more efficiently??
In case the second row is not sorted [idx1,idx1]=sort(ratings(1,:)); [idx2,idx2]=sort(ratings(2,:)); [kk,kk]=sort(idx2); ...

13 years ago | 1

Answered
I need to smoothen this curve.Need solution with exact code to be written in line.
x=[5 10 15 20 25]; nrz=[6.32 5.99 8.84 6.23 12.4]; rz=[10.23 8.10 5.00 6.63 7.71]; csrz=[5.77 6.25 8.06 5.50 7.45]; nrz_dp...

13 years ago | 0

| accepted

Answered
How to import column labels?
Maybe you want get(table_handle,'columnname')

13 years ago | 0

Answered
how can plot error with number of iteration?
[i j]=ndgrid(1:111,1:33); MPD=1; while(MPD>0.00001); G=(sum(sum((abs(v_now-v_prev))))); MPD=G/(m*n); % your c...

13 years ago | 0

Answered
forming matrix using vector
a=[ 1 2 3 4 5 6 7 8 9 2 1 2]; reshape(a,6,2)'

13 years ago | 0

| accepted

Answered
Print text on a graph with values, retaining superscripts?
text(Xt,Yt,['Y(t)=',num2str(A),'e^',num2str(B),'e^',num2str(C),'t'])

13 years ago | 0

Answered
Using 'solve' function in Simulink
Try <http://www.mathworks.com/help/simulink/slref/interpretedmatlabfunction.html Interpreted Matlab function> block, formerly c...

13 years ago | 0

| accepted

Load more