Beantwortet
How do I make a plot background black?
x=[1 2 3 4 5]; y=[10 20 30 40 50]; plot(x,y) set(gca,'color',[0 0 0])

mehr als 11 Jahre vor | 3

Beantwortet
how to read text file into formatted array
fid=fopen('FileName.txt') tline = fgetl(fid) out=[]; while ischar(tline) out{end+1,1} =tline tline= fgetl(fid); ...

mehr als 11 Jahre vor | 0

Beantwortet
find element of a cell or char array that matches a nonleading substring
x = {'010','030','310'} y = 'W_030_000' out=x( ismember(x,regexp(y,'\d+','match')))

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Undefined function or method 'mtimes' for input arguments of type 'cell' ERROR
Use N=E*A/L*[-1 1]*G*[ed{:}]'

mehr als 11 Jahre vor | 0

Beantwortet
Convert cell array into vector
a={[] [] [17] [] []} idx=find(~cellfun(@isempty,a))

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Elegant way to create dynamically an array inside a for loop ?
d=sum(bsxfun(@times,repmat(bsxfun(@times,r',w)',1,1,10),reshape(1:10,1,1,[])),2) b=d(:,:);

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Delete specific rows from a cell array
a={1200 'Unknown - State' 1700 'Rest' 1600 'Unknown - State' 2100 'City'} b=a(~ismember...

mehr als 11 Jahre vor | 2

Beantwortet
Naming and using signals within block parameters?
You can do it by creating your own pulse generator, using for example Matlab Function Block or others blocks like switchs. R...

mehr als 11 Jahre vor | 0

Beantwortet
Create a Matrix - Replace elements of a Matrix
A = [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] B=A B([randperm(8,4) randperm(8,2)+8])=1

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
how can i calculate how many number of times that 1 occurs.
x=repmat(1:4,4,1) % Example out=sum(x(:)==1) %or out=nnz(x==1)

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
??? Attempted to access nn(26,1); index out of bounds because size(nn)=[25,25].
y(1,m)=r(1,m)+nn(k,m); In this line the value of k will reach the value 26, because the size of nn is 25x25, Matlab wil...

mehr als 11 Jahre vor | 1

Beantwortet
Selecting random points from data file
x = [1:0.1:1000]; n=randi(5)*10 out=x(n:n:end)

mehr als 11 Jahre vor | 0

Beantwortet
Hi i have a problem with tha matlab simulink
In Matlab command windows type: mex -setup

mehr als 11 Jahre vor | 0

Beantwortet
Matrix multiplication: exponentiation before summation
*EDIT* A=randi(5,2,2) B=randi(5,2,3) D=sum(exp(bsxfun(@times,permute(reshape(A',size(A',1),1,[]),[2 1 3]),B')),2) out=...

mehr als 11 Jahre vor | 1

Beantwortet
GCA attributes axes changes
Use set command Example t=0:0.1:10; y=sin(t); plot(t,y); set(gca,'xlim',[0 5]) With the new version of Matlab ...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Why can't I plot such an easy graph?
for i = 1:100 x(i) = 1 + 2*i; y(i) = 3 + i; end plot(x,y)

mehr als 11 Jahre vor | 0

Beantwortet
I can't make this signal as like periodic signal
T0=2; % The period Ts=0.001 % The sample time t=0:Ts:T0 x_m=heaviside(t)-heaviside(t-T0/2); plot(t,x_m,'r') % plot in on...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
indexing must appear last in an index expression ERROR
You probably forgot an operator, maybe a prod * available(b,6)=available(i,6)*(min(find(available(i,6)*200>Le(i)==1)));

mehr als 11 Jahre vor | 0

Beantwortet
Remove path from file name
s='C:\Users\DougAnderson\Documents\MATLAB\SHtest\sig\hole 1.xlsx' out=regexp(s,'(?<=\\)[^\\]+$','match')

mehr als 11 Jahre vor | 1

Beantwortet
Plots return a blank window
B1=3 hmax=10 m1=10 w=1 d=4 for p=pi-B1:0.01:pi k=sin(2*pi*((p-pi)/B1)); hbiss=hmax*((2*pi)/(B1^2))*k; ...

mehr als 11 Jahre vor | 0

Beantwortet
How can you convert an array into multiple inputs?
A= [-1 1; -2 2; -3 3; -4 4]' b=cell(1,size(A,2)) c=num2cell(A,1) [b{:}]=ndgrid(c{:})

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Obtaining types of files in directory and put them into an array
s=dir, f={s.name} % The list of your files a=regexp(f,'(?<=\.)[^\.]+$','match') b=a(~cellfun(@isempty,a)) % list of non em...

mehr als 11 Jahre vor | 0

Beantwortet
How to obtain similar size of subplots?
t=0:0.1:10; y1=sin(t); y2=cos(t); subplot(211); plot(t,y1); subplot(212); plot(t,y2); Where do you see different size...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to use for loop for iterations.
c=[]; for i=1:3 a=rand(3,1); b=5.*(a.^2); c=[c;a b] end %or c=zeros(9,2); ii=1 for i=1:3 a=ran...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Averaging positive and negative values seperately for each array in a matrix
A=[0 2 2 -1 -7; 0 -1 -3 -2 6] x1=[arrayfun(@(x) mean(A(x,A(x,:)>0)),(1:size(A,1))') arrayfun(@(x) mean(A(x,A(x,:)<0)),(1:size...

mehr als 11 Jahre vor | 0

Beantwortet
Question about diff function
a=[ 2 4 8] b=diff(a) b= [4-2 8-4] a is 1x3 and b is 1x2

mehr als 11 Jahre vor | 0

Beantwortet
How can I sum the elements of a symbolic vector?
syms x1 x2 X = [1, x1, x2, x1^2, x2^2, x1*x2], out=char(X(1)) for k=2:numel(X) out=[out '+' char(X(k))] end

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Extracting non-alphabets from a string
Str='G02X56.32Y13.05Z4.5F0.1' str2double(regexp(Str,'\d+(\.\d+)?','match'))

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to solve an equation using "solve" and get a decimal approx?
eq='x^2-2*x-7' s=double(solve(eq))

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
finding the sum across the columns in a matrix
a=[1 2;3 4] s=sum(a,2)

mehr als 11 Jahre vor | 1

| akzeptiert

Mehr laden