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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 1

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

alrededor de 11 años hace | 1

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

alrededor de 11 años hace | 0

Respondida
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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

| aceptada

Respondida
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

alrededor de 11 años hace | 7

| aceptada

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

alrededor de 11 años hace | 2

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

| aceptada

Respondida
Create a Pause Button
Use pause function

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

Respondida
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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

| aceptada

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

alrededor de 11 años hace | 0

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

alrededor de 11 años hace | 0

Cargar más