Answered
How to do calculation on time values imported from Excel?
If a is your array a=[0.8153 ,0.2944,0.4792,0.8208,0.2917] out=datestr(a,'HH:MM:SS')

10 years ago | 0

Answered
add colums in a cell array of strings
s={'674' '719' '618' '631' '618' '631' '618' '631' '618' '674'} out=repmat({''},1,19) out(1:numel(s))=s

10 years ago | 0

Answered
index must be a positive integer or logical
when you write p(i), make sure that i is a positive integer, not equal to 0. in your case, you have p(i-1), if i is equal to 1,...

10 years ago | 0

Answered
how to add disturbance factor ?
* Use these a <http://www.mathworks.com/help/simulink/slref/clock.html clock block> to generate a time t, * multiply the time ...

10 years ago | 1

Answered
Substitute numbers in array
X=[1 2 3 4 5 6 7 8] XX=[fliplr(X(1:4)) fliplr(X(5:end))]

10 years ago | 0

Answered
how to change decimal places after point
v={'data_70.000_32.125';'data_70.124_32.120';'data_74.120_32.123'} w=cell(size(v)) for k=1:numel(v) a=regexp(v{k},'_','...

10 years ago | 0

| accepted

Answered
Matlab confirm is input is not an array
n = input('Enter in a positive integer: ') while n<0 | numel(n)>1 | fix(n)~=n n = input('Enter in a positive integer: ')...

10 years ago | 0

| accepted

Answered
Sorting elements of a matrix ignoring NaN
have = [5 NaN 4 9; 4 0 NaN 9; -6 NaN 2 3; 1 7 NaN -3] idx=isnan(have) [n,m]=siz...

10 years ago | 0

| accepted

Answered
How to multiply the constants of a symbolic vector?
r = 2 p = sym('p', [1 r]) syms k a =prod(p)

10 years ago | 0

| accepted

Answered
How can I combine data from multiple cells into one matrix?
A={rand(4,23) rand(5,23) rand(10,23)} B=cell2mat(A')

10 years ago | 0

| accepted

Answered
Plot window is coming up blank. Why?
t = 0:0.01:10; vs = 3.*exp(-t /3).*sin(pi*t); vl=vs; vl(vs<=0)=0; plot(t,vl)

10 years ago | 0

| accepted

Answered
Matrix dimension must agree
There are many mistakes in your code fc=[10 30]; the size of fc is [1 2], then fc(i,:) is not defined for i=2. also ...

10 years ago | 0

Answered
Split 3d array into 'i' equal mat files
v=rand(4,6,8) for ii= 1:6 filename=sprintf('my_data%d.mat',ii); s=v(:,ii,:) save(filename,'s'); end

10 years ago | 0

Answered
How to delete repeated elements in column
D={'Run' '' 'play' ''; '' 'go' '' 'sit' ; 'Run' '' 'play' ''; '' 'go' ''...

10 years ago | 0

| accepted

Answered
Can any one help me to correct this code
function h=dd1(n) h=zeros(1, length(n)); % n = [1 2 3 4 5 6 7]; % What this line is doing here? h(n==0) = 1; The call ...

10 years ago | 0

| accepted

Answered
Compare two strings, in different length, in two data sets in MATLAB, using if loop.
v={'ct' 12;'er' 14 ;'ct' 20 ; 'gf' 45 ;'ct' 78 ; 'er' 47} [ii,jj,kk]=unique(v(:,1)) out=[ii accumarray(kk,(1:numel(kk))',[]...

10 years ago | 0

Answered
Hi friends.I have a problem.There is error that is index must be integer or logical.
You can't write y(0), Matlab does not allow index equal to zero. the index should be positive integer

10 years ago | 0

| accepted

Answered
Read a txt file with engineering format
What kind of trouble? try this filename = 'Source.txt'; format long [B,delimiterOut]=importdata(filename);

10 years ago | 0

| accepted

Answered
All Possible combinations of rows
[ii,jj]=meshgrid((1:s1),(1:s2)); v=[ jj(:) ii(:) ones(s1*s2,1)]';

10 years ago | 0

Answered
Merging text files into one
s=[ 'copy ' sprintf('0906%d.txt+',15:22)] s(end)=[] system(s)

10 years ago | 0

Answered
Why I get this Error (State Space)?
Your diagram doesn't match your equation, you should have B*[dxr;xr]

10 years ago | 0

| accepted

Answered
Filter the rows of a matrix based on the values of one column
idx=ismamber(A(:,1),B) C=A(idx,:)

10 years ago | 0

| accepted

Answered
How I can write this in MATLAB ?
n=1:20 x=3*(-1/4).^n stem(n,x)

10 years ago | 0

| accepted

Answered
what is the problem with this code ?!!
syms n z a = ztrans(3*(-1/4)^n); b=subs(a,1:20) subplot(2,1,1) stem(b)

10 years ago | 0

| accepted

Answered
Why Ramp block output is continuous even when a discrete solver is chosen?
You can choose how your scope displays your plot. change the parameters of your scope, in "style,line": choose "no line".

10 years ago | 0

Answered
xlsread returns empty when reading a cell with a formula
[num,text,both] = xlsread('h&vlookup_if_and_or_Capacity_Planning.xlsx','Sheet1','B26','basic')

10 years ago | 0

Answered
Reading a *.txt document and extracting specific words/phrases
filetoread ='yourfile.txt'; fid = fopen(filetoread) k=1; v=cell(1,1) while 1 tline = fgetl(fid); ...

10 years ago | 0

Answered
removing zeros from matrix
v=[0 0 2 3 4 0; 1 0 2 0 0 1; 3 2 1 0 0 0; 0 1 0 3 0 1] out=reshape(v(v~=0),size(v,1),[])

10 years ago | 1

Answered
How to delete an element of a vector?
v=[1 10 3 4 10] w=v(v~=10) %or v(v==10)=[]

10 years ago | 1

| accepted

Answered
Covert a cell to multidimensional matrix
%------------Example--------------------------- s=arrayfun(@(x) randi(5,randi(5),100),1:5,'un',0) %---------------the code--...

10 years ago | 0

| accepted

Load more