Answered
Dots!, Dots!, Dots! What are they doing!?
When your expression is too long, you can write it in multiple lines

11 years ago | 1

Answered
Split a matrix in rows according to a vector
x=cumsum(B)-B+1 y=cumsum(B) out=arrayfun(@(ii,jj) A(ii:jj,:),x,y,'un',0)

11 years ago | 0

Answered
How I can get a vector from another through swaps?
Do you mean randomly? A=[1 5 8 7 4 3 2 6] B=A(randperm(numel(A)))

11 years ago | 0

Answered
how to write values to excel sheet
Can you give more details about your arrays, are they same size? What about the names? maybe you should save all your result in ...

11 years ago | 0

Answered
how to calculating hourly average?
v=randi(9,1,55) % Example n=ceil(numel(v)/10)*10 v(end+1:n)=nan a=reshape(v,10,[]) idx=~isnan(a) for k=1:size(a,2) o...

11 years ago | 0

| accepted

Answered
Split components of a symbolic vector into positive and negative
syms x1 x2 y1 y2 X=x1^2*y2^5 - 2*y1^2*x1*x2+ 3*x1 -y2 [s1,s2]=coeffs(X,[x1,x2,y1,y2]); idxp=s1>0; Xp1=s2(idxp); Xn1=s...

11 years ago | 0

Answered
Find the index of the last numeric element of a column including NaNs
find(~isnan(fliplr(x)),1)

11 years ago | 0

Answered
Getting Error: Unexpected MATLAB expression.
syms alpha beta gamma real % write down the rotation matrices using the symbolic parameters alpha, beta, gamma R_B1 = [1,0,0...

11 years ago | 0

Answered
calculate statistics every quarter of an hour on time series data
x=datenum('2015-01-01 00:00:0'):1/(24*12):datenum('2015-01-01 2:00:0') y=datestr(x,'yyyy-mm-dd HH:MM:SS') D = datevec(y,'yyy...

11 years ago | 0

Answered
How to plot .bin file?
Use <http://www.mathworks.com/help/matlab/ref/fread.html fread function> to read your file and <http://www.mathworks.com/help/ma...

11 years ago | 0

Answered
How to select a data set from columns having using criteria?
v=[time A B C acc ]; idx=v(:,5)<10&v(:,4)<20; out=v(idx,:) Time_criteria=v(find(idx,1),1)

11 years ago | 0

Answered
how can I solve this equation? I am trying with 'solve' function but getting error [ empty sym ]
eq='2.82167 - 0.0092752*(T_f - 216.65)*(5.94429e-11*(0.387*(4.12514e8*T_f - 8.93711e10)^(1/6) + 0.6)^6 - 0.0123334)^(1/3) ...

11 years ago | 0

Answered
How can I divide multiple matrices into individual arrays?
A = [1, 2, 3; 4, 5, 6; 0 0 0]; B = [3, 2, 1; 6, 5, 4; 0 0 0]; out=arrayfun(@(x,y) [x,y],A,B,'un',0); out=out(:); Now you...

11 years ago | 1

| accepted

Answered
how to create a 1,12,123,1234 pattern in a triangle
n=5 out=arrayfun(@(x) str2num('1':num2str(x)),1:n)'

11 years ago | 1

Answered
Control "Delay" block by setParam?
set_param('untitled/Delay','DelayLength','2')

11 years ago | 0

| accepted

Answered
Is it possible somehow make vector of structure?
a=rand(1,10); b=rand(1,10); s=struct('field1',num2cell(a),'field2',num2cell(b))

11 years ago | 0

Answered
Help importing mixed data
s=importdata('myfile.aspx') date=s.textdata num=s.data num=num(:,2)

11 years ago | 0

| accepted

Answered
How do I include zeros when converting from an integer to a string?
a=1234 b=sprintf('00%d',a)

11 years ago | 1

Answered
Create a table from symbolic vectors
G=sym('x',[1,6]) H=num2cell(G) table(H{:})

11 years ago | 0

Answered
Legend- if plot is empty?
x=nan and y=nan is not an empty plot. x1=[1 2 3] x2=[] y1=[1 2 3] y2=[] x={x1,x2} y={y1,y2} for k=1:numel(x) if...

11 years ago | 2

Answered
spliting date and time strings in a table
data={'23/06/2015 00:50:12';'24/06/2015 12:30:45';'25/06/2015 13:00:01'} a=datevec(data,'dd/mm/yyyy HH:MM:SS') date=datestr(...

11 years ago | 1

| accepted

Answered
Basic equations from excel to matlab?
If A is your matrix A=rand(4,130), % Example CI= 87, DP=120, DV=126 out=A(:,CI)+A(:,DP)/2+0.4095*(A(:,DV)-3.44/2)-(A(:,...

11 years ago | 0

| accepted

Answered
How to use 'Switch case' with Matlab Function Block in Simulink?
What if n is different from 1 and 2? Try this function result = fcn(n) %#codegen x = 3; y = 2; z=0; switch n case...

11 years ago | 0

Answered
How to loop string files with the help of xlswrite to write on new areas of same sheet an excel file
ii=2, jj=3, range=sprintf('A%d:C%d',ii,jj)

11 years ago | 0

| accepted

Answered
how to convert 1100111 to 1 1 0 0 1 1 1
a={'11100';'10000';'10101'} out=cell2mat(cellfun(@(x) x-'0',a,'un',0))

11 years ago | 0

Answered
Solve a matrix-form equation
s=sum(Constants(:,1) .* (100/333).^Constants(:,2) .* x.^Constants(:,3) ) sol=solve(s)

11 years ago | 0

| accepted

Answered
Why this error is coming in my code?
There are many problems in your code The first line: zeros(1500,2); What this line means? then after you wrote ze...

11 years ago | 0

Answered
inverse of sinc function : how to evaluate?
Use this syms x sol=double(solve(sinc(x)==0.11))

11 years ago | 1

Answered
min and max of a vector
A=randi(20,1,20) B=randi(20,1,20) C=randi(20,1,20) D=randi(20,1,20) E=[A.*C;A.*D;B.*C;C.*D] min(E)

11 years ago | 0

Answered
Find the highest value and its entry of a (2xn) matrix in each column
v=[17 23 4 10 11; 24 5 6 12 18] [a,idx]=max(v)

11 years ago | 0

| accepted

Load more