Respondida
How to print out a cell array inside a cell array
How did you manage to get that so deeply nested? Let's see the code that generated the array and work on it... But, to answer ...

casi 7 años hace | 0

| aceptada

Respondida
How to compare variables without if statement
>> assert(3==4,'Mismatch') Mismatch >> assert(3==3,'Mismatch') >> ADDENDUM: Of course, you can make things more interesti...

casi 7 años hace | 0

Respondida
import csv file and use the data in Matlab
The problem is the file has explicit "" for string variables built into it...that overrides what readtable would otherwise do fo...

casi 7 años hace | 2

| aceptada

Respondida
Removing rows - duplicates based on a condition
[~,ia]=unique(A(A.Size==1,1),'first'); B=[A(A.Size==0,:);A([ia+find(A.Size==0,1,'last')],:)]; returns >> B B = 6×3 table ...

casi 7 años hace | 0

| aceptada

Respondida
extracting dates within a text
matchstr='LoomingExp'; % string to match c=textread('book1.csv','%s','delimiter',''); % read as...

casi 7 años hace | 0

| aceptada

Respondida
How to write Continue Long Statements on Multiple Lines ?
The ugliness of the C-style formatting string in all its glory exhibited!!! Why TMW didn't go to the trouble to keep Fortran FO...

casi 7 años hace | 0

Respondida
How to read an excel spreadsheet ignoring text and comments
The venerable xlsread will return numeric, text, and the raw data in separate locations. Probably better is to use the detectIm...

alrededor de 7 años hace | 1

Respondida
Storing the positions of neighbouring elements that have specific values.
>> i0=3; j0=4; >> [i,j]=find(~A(i0-1:i0+1,j0-1:j0+1)); >> [i,j] ans = 1.00 1.00 2.00 ...

alrededor de 7 años hace | 0

| aceptada

Respondida
Averaging setions of a matix
mnA=cell2mat(arrayfun(@(n)mean(A(1:n,:)),[2:size(A,1)].','uni',0));

alrededor de 7 años hace | 0

| aceptada

Respondida
What exactly is happening in this line of code speech_out = speech(1:1/1.01964:length(speech),:);?
MATLAB rounds to nearest integer for the fractional subscript for indexing. Not recommended technique, use the Signnal Processi...

alrededor de 7 años hace | 1

Respondida
Sort function does not return correct indices
870 is not wrong... -7.2 (1) < -6.2 (3) neither is 884. 884 -15.89 18.31 -10.21 18.31 -10.21 -15.89 2 3 1 ...

alrededor de 7 años hace | 1

| aceptada

Respondida
Could someone please help me setup an interpolation script to find atmospheric conditions at various altitudes?
function [T, P, rho] = standard_atm(alt) ... % alt sigma delta theta temp press dens a visc k...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to overlap time vectors and plot in multiple axis ?
See FEX https://www.mathworks.com/matlabcentral/fileexchange/1017-plotyyy

alrededor de 7 años hace | 0

Respondida
Change width on fitted line in function fitlm
Yeah, save the handles returned by plot for the linear model fit... mdl=fitlm(T(Index,3),F); hMDL=plot(mdl); hFIT=findobj(hMD...

alrededor de 7 años hace | 0

| aceptada

Respondida
Identifying x value at y on an xy plot
P=0.5; % P to find iy=find(y>P,1); % first point past P xp=interp...

alrededor de 7 años hace | 0

Respondida
How to built a histogram in MatLab as Excel did it?
y=[14;21;14;9;16;10;16]; bar(y) That's a bar plot, not histogram.

alrededor de 7 años hace | 0

| aceptada

Respondida
How to use a code to get the corresponding value of a loop in another file
Your outer loop range is 0:45:360 but you only set a value for the struct environment for those values less than 360. What is i...

alrededor de 7 años hace | 0

| aceptada

Respondida
trapz whe x is a matrix
TMW only implemented variable X spacing for the full array, not by column (or row). Have to loop to do it...worthy of an enhanc...

alrededor de 7 años hace | 0

| aceptada

Respondida
Weekly Average per Year For Loop
No loops should be needed. If you haven't convert the date data to ML datetime and then compute the grouping variable wkyr as ...

alrededor de 7 años hace | 0

Respondida
Begginer's Question about matrixes
press=Ps*(1+(Lb/Ts)*altitude).^(-g0*M/R*Lb); dp=diff(press); "The Matlab way" is to use the vectorized abilities built into op...

alrededor de 7 años hace | 0

| aceptada

Respondida
Function doesn't return a vector from a vector input
Yes, you didn't read about logical IF if Ffork0+Inc_Ffork*t <= Ffork_max is True iff every element of Ffork0+Inc_Ffork*t is <=...

alrededor de 7 años hace | 1

Respondida
Unspecified coefficients from function 'fit'
fit returns a fit object (either cfit or sfit, depending on curve or surface). There are functions to return things out of the ...

alrededor de 7 años hace | 0

Respondida
Mean of a subset of columns for every row
N=10; M=reshape(mean(reshape(Data.',N,[])),size(Data,2)/N,[]).';

alrededor de 7 años hace | 1

| aceptada

Respondida
how to set stacked bar graph legend?
Did you try legend('A','B','C') ???

alrededor de 7 años hace | 0

| aceptada

Respondida
Hello , I have an issue with getting everything to show on my figure correctly. I made four subplots but for some reason my 4th subplot is not showing and also the legend, text and title is not showing correctly either
You plot() BEFORE you create the subplot; so the first plot is killed/destroyed after it is made when the subplot(2,2,1) call i...

alrededor de 7 años hace | 2

| aceptada

Respondida
Title for each table in one figure
Whole lot of code to wade through but the first little bit is just N = 15; Alpha0=0.05; alpha=Alpha0./(N:-1:1); I don't do G...

alrededor de 7 años hace | 0

| aceptada

Respondida
Copying arrays from another file
You don't "copy", you just read each file and catenate the (I presume) 2D array to the third dimension of the initial array. d=...

alrededor de 7 años hace | 0

Respondida
Function inside for loop that calls multi-column variables
Vectorize the function instead..."the MATLAB way" function [d1km]=latlondist(LL1,LL2) RADIUS=6371; LL1=deg2rad(LL1); L...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to find n number of low value's position or column number from a cell ?
NtoFind=5; [Mn,iMn]=mink(X,NtoFind);

alrededor de 7 años hace | 0

Respondida
MATLAB syntax (parantheses without intermediate steps)
Because to date TMW has chosen to not implement post-addressing expressions on results. "WHY?" you'd have to ask TMW and it's u...

alrededor de 7 años hace | 0

| aceptada

Cargar más