Beantwortet
How to define a range to iterate with gaps in between?
for k= [1:10 15:20 25:30]

etwa 10 Jahre vor | 0

Beantwortet
count the number of 1 in each row
A = [0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 1 0 0 0 1] B=reshape(A,size(A,1),5,[]) out=sum(B,2) out=out(:,:)

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Simulink model does not work beginner
use this <</matlabcentral/answers/uploaded_files/51354/mem.png>>

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
how to do this on matrix to change they look?
flipud(A)

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Find common words in 2 strings
str1 = ('rabbit is eating grass near a tree'); str2 = ('rabbit is sleeping under tree'); str=intersect(strsplit(str1),strspl...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
How to remove specific elements in a matrix
ii=[1 2 3] jj=[2 3 4] [n,m]=size(A); B=zeros(n,m-1); for k=1:n a=A(k,:); a(jj(k))=[]; B(k,:)=a end

etwa 10 Jahre vor | 0

Beantwortet
how to use hist in plotyy
Look at this example t=1:10 x=randi(10,1,10) y=sin(t) hist(x) hold on plotyy(nan,nan,t,y)

etwa 10 Jahre vor | 2

| akzeptiert

Beantwortet
how can alter this code to select some matrix ?
X={[ 1 1 0;0 1 0;0 0 1 ], [ 0 1 0;1 1 1;1 0 0]... [1 1 1;0 1 0;1 1 0],[1 0 1;1 1 0;1 0 0]} X{2} X{4}

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Automatic naming of matrix
This is not good, Use instead a cell array matrix{1} = [1:10]; matrix{2} = [1:20] <http://matlab.wikia.com/wiki/FAQ#How...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
How can I convert 'file.fig' to to jpg?
Use saveas function <http://www.mathworks.com/help/matlab/ref/saveas.html>

etwa 10 Jahre vor | 0

Beantwortet
When I import excel data...
for k=1:3 a{k}=xlsread(sprintf('%d',k)); end a{1} a{2} a{3}

etwa 10 Jahre vor | 1

Beantwortet
how can I obtain the unit-ramp of a transfer function and plot it and thanks in advance
H=tf(10,[1 2 10]) t=0:0.01:10; slope=1; u=slope*t; lsim(H,u,t)

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
outputing data into a txt file
a=[25,27,24,36] b=[19,20,22,17] c=[12,34,56,33] M=[a;b;c] dlmwrite('data.txt',M)

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
How to repeat a column 20 times one below the other?
repmat(A,20,1)

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
Generate a character matrix through indexing and a for loop
top3Table(i,1:2) = Row To pre-allocate your matrix: top3Table = ones(3,2)

etwa 10 Jahre vor | 0

Beantwortet
colorbar tick decimal round
plot(1:10) h=colorbar t=get(h,'Limits'); T=linspace(t(1),t(2),5) set(h,'Ticks',T) TL=arrayfun(@(x) sprintf('%.2f',x),T,'u...

etwa 10 Jahre vor | 5

| akzeptiert

Beantwortet
replace any nan value in the table by zero
M(isnan(M))=0

etwa 10 Jahre vor | 0

Beantwortet
How to select 5 rows of a data set in rolling basis
A=randi(9,20,4) n=size(A,1); for k=1:n-4 a=A(k:k+4,:); A(k:k+4,:)=a(randperm(5),:); end

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
How can I save value of a variable when calling the same function again?
Because in the first line you wrote round=0 You can declare the variable round as persistent function ------- pers...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
index must be a positive integer or logical.
Use ./ instead of / and also you a missed a multiplication operator * h = 1./(1+i*(w*(l/r)-(1./(w*r*c))));

etwa 10 Jahre vor | 0

Beantwortet
How to write a MATLAB function to find all the divisors between 2 and 20
See mod function

etwa 10 Jahre vor | 0

Beantwortet
How can I find unique values in column ?
[~,b]=unique(m(:,1),'stable') out=m(b,:) If you want to choose the second column randomly [~,~,c]=unique(m(:,1),'stab...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
how to solve a polynomial equation analytically?
solve('x^3-6*x^2+9*x+4') or roots([1 -6 9 4])

etwa 10 Jahre vor | 1

Beantwortet
why is my plot not showing anything
landa is always a complex number.

etwa 10 Jahre vor | 0

Beantwortet
recognition of different cases
yesorno = input('Run the function again? (Yes/No)\n','s') Then compare upper(yesorno) with 'YES' or 'NO'

etwa 10 Jahre vor | 0

Beantwortet
Finding multiple roots of a polynomial
solve('x^3 - x^2 + x + x^0.5 - 10 ')

etwa 10 Jahre vor | 0

Beantwortet
Find x from y using a fit equation?
Use interp1 function

etwa 10 Jahre vor | 0

Beantwortet
How to Store ss and ls outside the loop?
k=0; for T = 1083.4:6:1458; k=k+1; syms xs xl; [xs,xl]= solve([(xs == exp((b2 * (1 - (T/a2)))/(R * T))*xl), ((...

etwa 10 Jahre vor | 0

Beantwortet
fall time of square wave
If y is your signal idx=strfind(y,[1 0])

etwa 10 Jahre vor | 1

Mehr laden