Answered
create 3-dimension matrix
c=cat(3,z1,z2)

11 years ago | 1

Answered
binary matrix that has different orders of 0 and 1
n=3 out=dec2bin(0:2^n-1,n) %or out=dec2bin(0:2^n-1,n)-'0'

11 years ago | 3

Answered
How to normalize a matrix such that the maximum value is 1?
If you have Image Processing Toolbox new_y1=mat2gray(y1); new_y2=mat2gray(y2); % new_y1 and new_y2 have both the same m...

11 years ago | 0

| accepted

Answered
How to extend a array by multiplying internal values e.g. [1 2 3 4] to [1 1 1 2 2 2 3 3 3 4 4 4]?
A = [1 2 3 4 5 6 7] B=bsxfun(@times,ones(4,1),A); out=B(:)'

11 years ago | 0

Answered
Convert char to cell
ze1=struct('Nome',[],'Aperlido',[],'Categoria',[],'Numero',[],'Mail',[],'Telefone',[]) ze1.Nome{end+1}=input('Introduza o seu...

11 years ago | 0

Answered
Sorting data extracted from the name of a group of files
coord=cell2mat(cellfun(@str2double,regexp(files,'(?<=(x\+)|(y_\+))\d+(\.\d+)?', 'match'),'un',0))

11 years ago | 0

Answered
How do i solve equations for 2 unknowns?
syms X Y X1 X2 Y1 Y2 T1 T2 V sol=solve(V*T1==sqrt((X1- X )^2+(Y1- Y )^2),V*T2==sqrt((X2- X )^2+(Y2- Y )^2),X,Y)

11 years ago | 0

| accepted

Answered
How to extract information from the name of a file without using strsplit function?
files=[{' x+0.000mm_y_+0.000mm_z_+0.000mm.dat_ '} {' x+10.000mm_y_+20.000mm_z_+30.000mm.dat_ '}] coord = regexp(files,'\d+(\...

11 years ago | 0

| accepted

Answered
the number of occurences of each character of one string,in another
str='MEQNGLDHDSRSSIDTTINDTQKTFLEFRSYTQLSEKLASSSSYTAPPLNEDGPKGVASAVSQGSESVVSWTTLTHVYSILGAYGGPTCLYPTATYFLMGTSKGCVLIFNYNEHLQTILVP...

11 years ago | 1

| accepted

Answered
Get structure elements across fields
Another way: d=struct('f1',num2cell(randi(10,1,10)),'f2',num2cell(randi(10,1,10)),'f3',num2cell(randi(10,1,10))) n=4 e=d(n...

11 years ago | 0

Answered
I needed matlab code for cumulative sum of column vector
yourarray=[1 2 3 4 5] out=cumsum(yourarray)

11 years ago | 0

Answered
How to find zero on plot?
x=[1 2 0 3 4 5 3 2 0 4 5] out=find(x==0)

11 years ago | 0

Answered
Help comparing two matrices
sign(m1-m2) % Example m1=[1 4;10 20] m2=[0 2;10 40] out=sign(m1-m2)

11 years ago | 1

Answered
How can I get a desired input? Also, why does 1 = 49 and 2 = 50 etc. Anyway to keep there values?
N=input('Enter your student number:'); if N>0 disp('Sum of digits:') disp(sum(num2str(N)-'0')) end

11 years ago | 0

Answered
How to get matlab import to see col with nan as number
d=importdata('import_test.csv') h=d.textdata; header=h(1,:) yourdate=h(2:end,1) YourData=d.data %or [a,b,c]=xlsr...

11 years ago | 0

| accepted

Answered
Plotting a colored surface in 2D
Look at this example x=1:0.1:4 y=1:0.1:4 [X,Y]=meshgrid(x,y) Z=sin(X).^2+cos(Y).^2 surf(X,Y,Z) view(2)

11 years ago | 8

| accepted

Answered
How can i fix it?
YourFolder='E:\matlab' for k=1:10 FileName=sprintf('pic%d.jpg',k) File=fullfile(YourFolder,FileName) % do ...

11 years ago | 0

| accepted

Answered
How to refresh the data in polar plot
x = linspace(0,8); y = sin(x); [theta,rho] = cart2pol(x,y) h=polar(theta,rho,'--r') h.YDataSource = 'y'; y = sin(x.^3); ...

11 years ago | 1

| accepted

Answered
Deleting zeros from cell matrix without resizing or reshaping matrix
a={ 1 2 6 2 6 6 1 0 0;1 7 2 5 0 6 4 7 1;3 2 0 2 6 7 4 7 3 } a(cellfun(@not,a))={[]}

11 years ago | 1

| accepted

Answered
how to leave a variable on one side of the equation
s='-3*a+2*b==10*sin(c)' out=solve(s,'b')

11 years ago | 1

Answered
xPC Target related query
That depends on the version of your Simulink. Lunch your Simulink, then under Simulink Real Time (or formerly XPc Target) click...

11 years ago | 0

| accepted

Answered
Change a character array to time
s='113203' a=datenum(s,'HHMMSS') out=datestr(out,'HH:MM:SS')

11 years ago | 1

| accepted

Answered
plot using with characters which are cell and numeric data.
data=[1;2;3;4;5;6] ids={'12.1a';'1.2b';'1.3c';'1.4d';'1.7e';'1.8f'} plot(data,'b') set(gca,'XTick',1:numel(ids)) set(gca,'...

11 years ago | 0

| accepted

Answered
finding the derivative of a graph
Example t=0:0.1:10 y=t.^2 dy=gradient(y,t) subplot(211); plot(t,y) subplot(212) plot(t,dy)

11 years ago | 1

| accepted

Answered
color plotting matlab yellow
plot(x1,'y') %or plot(x1,'color',[1 1 0]) Read the <http://www.mathworks.com/help/matlab/ref/plot.html plot do...

11 years ago | 1

| accepted

Answered
I am trying to create a table but somehow can't.
What those 3 dots are doing? T = table (Time,Sx,Sy,'RowNames',LastName);

11 years ago | 0

Answered
A question about for loop
p=[.5 .7 .2]; idx=nchoosek(1:3,2) out=0; for k=1:size(idx,1) m=setdiff(1:3,idx(k,:)); out=out+p(m)*(1-p(idx(k...

11 years ago | 0

| accepted

Answered
Help comparing two matrices
idxp=A>B idxn=A<B C=zeros(size(A)) C(idxp)=1; C(idxn)=-1

11 years ago | 0

| accepted

Answered
Exracting n characters from all elements of cell array
date1=datestr(date_time,'dd/mm/yyyy') hour1=datestr(date_time,'HH:MM:SS')

11 years ago | 0

| accepted

Load more