Respondida
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')

más de 10 años hace | 0

Respondida
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

más de 10 años hace | 0

Respondida
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,...

más de 10 años hace | 0

Respondida
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 ...

más de 10 años hace | 1

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

más de 10 años hace | 0

Respondida
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},'_','...

más de 10 años hace | 0

| aceptada

Respondida
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: ')...

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

Respondida
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)

más de 10 años hace | 0

| aceptada

Respondida
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 ...

más de 10 años hace | 0

Respondida
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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

Respondida
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 ...

más de 10 años hace | 0

| aceptada

Respondida
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))',[]...

más de 10 años hace | 0

Respondida
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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

Respondida
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)

más de 10 años hace | 0

| aceptada

Respondida
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".

más de 10 años hace | 0

Respondida
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')

más de 10 años hace | 0

Respondida
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); ...

más de 10 años hace | 0

Respondida
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),[])

más de 10 años hace | 1

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

| aceptada

Cargar más