Beantwortet
How to convert from a for loop to a while loop
Don't use the variable i, it's used by Matlab to represent complex numebers ii=3 while ii<n x = [1:ii]; y = x.^2...

etwa 11 Jahre vor | 0

Beantwortet
Add directory path to fopen
file=fopen(fullfile(pwd,FileName),'wt')

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to delete a row with specific letter
A(ismember(A(:,1),'K'),:)==[]

etwa 11 Jahre vor | 0

Beantwortet
Rounding Vector Entries with zeros after the decimal place to integers
sprintf('%d\n',T) or out=num2str(T)

etwa 11 Jahre vor | 0

Beantwortet
How to convert a vector to a matrix in Matlab?
a=[1 2 3 4 5 6 7 8 9] reshape(a,3,3)

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
I have a string S='010101' I need to take each element from the string and check whether it 1,if it is one then the count is incremented by one in matlab?
S='010101' out=nnz(S-'0') To correct your for loop St='010101'; count=0; a=0; for i=1:6 a=St(i); if(a=='1')...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Performing equations on individual elements of a 3D Matrix, and then summing that along the z column
A=randi(10,4,3,2) % Example of your matrix result out=sum(A,3)

etwa 11 Jahre vor | 0

Beantwortet
How to plot a chart(e.g bar chart) given a dublicate x values?
time_duration=[2 4 3 6 7 3 7] Altitude=[20 30 40 50 60 60 50] [unique_time_duration,jj,kk]=unique(time_duration) new_Al...

etwa 11 Jahre vor | 0

Beantwortet
I would like axis off except xlabel, but this is not working, why?
set(gca,'xtick',[],'ytick',[],'title',[],'ylabel',[]),

etwa 11 Jahre vor | 1

Beantwortet
How to use really small dots in scatter plots?
h=plot(1:10,1:10,'.'); set(h,'markersize',4)

etwa 11 Jahre vor | 1

Beantwortet
Write Tabular Data to Text File Write a short table of the exponential function to a text file called exp.txt.
*Edit* A = input('Enter A: '); B = input('Enter B: '); func = @(x) exp(x)-2*cos(x); e = 1; fileID=fopen('fic.txt','w')...

etwa 11 Jahre vor | 0

Beantwortet
How to run a program for three different values
temp= [30,40,50] for k=1:numel(Temp) T=temp(k) % add your ptogramme end

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to display a matrix as a image ?
A=randi([-1 200],120,50) map=[0 0 0;1 1 1;1 0 0]; idx1=A==-1 idx0=A==0 idx2=A>0 A(idx1)=1 A(idx0)=2 A(idx2)=3 image(A)...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
How can I determine if specific cells within an array are empty?
That means edgeXPlus is not a cell array. Use edgeXPlus(1) instead of edgeXPlus{1}

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Filling different size vectors with NaN
v=[1;2;3;4] j=[5;6] n=max(numel(v),numel(j)) v(end+1:n)=nan j(end+1:n)=nan

etwa 11 Jahre vor | 7

| akzeptiert

Beantwortet
Find index between two vectors
A=[2015 1 1 14 59 0 2015 1 1 15 0 0] idx=find(A(:,4)==14 & A(:,5)=59) or idx=find(ismember(A(:,4:5),[14 59],'rows'...

etwa 11 Jahre vor | 2

| akzeptiert

Beantwortet
Legend on MATLAB FIGURES
t=0:0.1:10; y1=sin(t); y2=cos(t); plot(t,y1,t,y2); leg={'leg1','leg2'}, hleg=legend(leg); set(hleg,'fontsize',6)

etwa 11 Jahre vor | 0

Beantwortet
Correct use of Semilogx
set(gca,'xscale','log')

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Extracting data from multiple files with header.
f=dir(fullfile(YourFolder,'*.txt')); files={f.name} for k= 1:numel(files) fid = fopen(fullfile(YourFolder,files{...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Create a Pause Button
Use pause function

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
[SOLVED] Save image in cell array ARRAY{i,y} and access them with image(ARRAY{i,y})?
image(stiAll{1,1})

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
how convert 13 digits of timestamp?
use format short or s=1238536800000 fprintf('%6.6g\n',s)

etwa 11 Jahre vor | 0

Beantwortet
Problem in reading binary data from excel file
1.0001e+21 is not also a binary number. Before importing your xlsx file, change the format of your cells to text.

etwa 11 Jahre vor | 0

Beantwortet
How can I sum an expression over the indices of an array?
A=[1, 2, 3, 4]; syms x out for y=2:numel(A) out(y-1)= sum(A(y)-A(y-1:-1:1))*x end

etwa 11 Jahre vor | 0

Beantwortet
problem with datenum: it does not return the same number for the same date
If we check this, there is no problem s={'09/10/2008' '09/10/2008' '10/10/2008' '10/10/2008' '13/10/2008' ...

etwa 11 Jahre vor | 0

Beantwortet
Trying to remove range of negative numbers from a specific column of multiple rows
dlen = 18*fix(length(Glxc{:})/18); % Set Row Length Glxcr = reshape(Glxc{:}(1:dlen), 18, [])'; ...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
plot 3D surface for this function: X=F(phi,beta,rho) Y=F(phi,beta,rho) Z=F(phi,beta,rho)
phi1=-pi/2:0.01*pi:pi/2; phi2=-pi/2:0.01*pi:pi/2; phi3=-pi/2:0.01*pi:pi/2; X=0.4*cos(phi1).*sin(phi3)+0.4*sin(phi1).*cos(ph...

etwa 11 Jahre vor | 0

Beantwortet
Matrix with at most one 1 per row
A=zeros(4) n=size(A,1) idy=randperm(n) idx=1:n idxy=sub2ind(size(A),idx,idy) A(idxy)=1 If the matrix is not square ...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to get most similar row in matrix A to matrix B
a = sum(abs(bsxfun(@minus,A,B)),2) [~,t] = min(a); out1 = A(t,:)

etwa 11 Jahre vor | 0

Beantwortet
How to change Horizontal size of a Constant block based on the "Value" of the block in order to make the value visible
If you don't want to change the position of your block. Get it's actual position pos=get_param('ModelName/Constant','Positi...

etwa 11 Jahre vor | 0

Mehr laden