Respondida
Concatenate variables from multiple files to just one single matlab file
d=dir('station*.mat'); % return the list of files n=length(d); % number files...

alrededor de 8 años hace | 0

Respondida
Adding values of each element of cell array
Don't "double-up" cell indexing; makes dereferencing much more complicated than need be... Define x as x{1,1}=[0.8,1.4];...

alrededor de 8 años hace | 0

| aceptada

Respondida
How to pull out numbers after specific string in txt file?
That's a complex file and there are, it appears, multiple sections; you'll have to decipher just how to determine which one is t...

más de 8 años hace | 0

Respondida
Push button for open tecplot
I haven't used TecPlot in years, but there are quite a lot of things it can do that would be extremely difficult to do in Matlab...

más de 8 años hace | 0

Respondida
How to store each iteration value and plot it ?
Preallocate for |L2| and keep and increment an index inside the loop and store into an array L2=zeros(N,1); ...

más de 8 años hace | 0

| aceptada

Respondida
Filling an area between max and minimum lines on a plot
See if <https://www.mathworks.com/matlabcentral/answers/414852-how-to-plot-an-area-limited-by-two-functions#answer_332770 Answer...

más de 8 años hace | 1

| aceptada

Respondida
Error using xlim for datetime values
OK, I answered in couple of comments, but they're buried so will post (yet another :) ) Answer to the original problem only. ...

más de 8 años hace | 1

Respondida
Calculations for arrays inside an array
Making the array content cell arrays complicates dereferencing but something like structfun(@(c) mean(c{:}(:,5)-c{:}(:,4)),...

más de 8 años hace | 1

Respondida
Specify wich values appear on a plot legend
Use the handles of the lines you wish to add legends to... nFig=8; % set the numbers via variables n...

más de 8 años hace | 0

| aceptada

Respondida
How do I import numerical entries from an excel sheet as strings?
opt=detectImportOptions('testmatlabpartnumberreadin.xlsx'); % see what Matlab thinks opt.DataRange='A1'; ...

más de 8 años hace | 1

| aceptada

Respondida
Determining the max angle from the cell array
A cell array just gets in the way here. I'd look back at how the Ang_F1 is generated and see if can't just get the array direct...

más de 8 años hace | 0

Respondida
How do I Remove Double Quotes from my Table?
The quotes are a fignewton of the Matlab display formatting; you can't eliminate them from the command window excepting by eithe...

más de 8 años hace | 0

| aceptada

Respondida
Error using xlim for datetime values
And, while above Answer is true, the comment about using |readtable| is sufficiently worthwhile will add another based on it wit...

más de 8 años hace | 1

Respondida
Error using xlim for datetime values
While Steven L has the better overall, I'll point out the specific cause for the error in the existing code; as the other two re...

más de 8 años hace | 0

Respondida
How to add two different linear fits to the same graph
function y=piecewise(coef,x) % return piecewise linear fit given [b1,m1,c,m2] as coefficient array and vector x % c is b...

más de 8 años hace | 1

| aceptada

Respondida
How to count the number of black pixels in each row & column seperately?
_x_ is the image array... [rmax,rloc]=max(sum(x)); [cmax,cloc]=max(sum(x,2));

más de 8 años hace | 0

Respondida
How do I make a user defined function with the input being the file name in a string?
The users will probably very quickly get very tired of having to type in a fully-qualified file name. I'd suggest something m...

más de 8 años hace | 0

Respondida
How can I convert binary vector to a single binary number?
The representation as 010110 visually is immaterial; to do that it will have to be character: b= [0 1 0 1 1 0]; sprintf(...

más de 8 años hace | 4

| aceptada

Respondida
Too high correlation value from xcorr and corrcoef for uncorelated sequences
Ah, but there _is_ quite a lot of correlation; remember it's not the magnitude of the values that matters, it's only whether the...

más de 8 años hace | 0

| aceptada

Respondida
How to subtract 'datetime' from 'datetime' in MATLAB GUI ?
The problem is converting to strings instead of just comparing... What _will_ work to compute the offset including DST if in ...

más de 8 años hace | 0

| aceptada

Respondida
Importing csv with dates
t=readtable('test-data.csv'); plot(t.Date,[t.MinimumTemperature__C_ t.MaximumTemperature__C_]) legend('Tmin','Tmax') ...

más de 8 años hace | 1

Respondida
get vector orientation from coordinates of two ends
doc atan2 theta=atan2(x2-x1,y2-y1); If you'll write x,y as vectors as x=[x(1) x(2)]; y=[y(1) y(2)]; then you c...

más de 8 años hace | 1

| aceptada

Respondida
How to keep ordering of found indices when using contains?
It's not being sorted, it's returning the matches that are found globally just like you asked it to do, not by individual elemen...

más de 8 años hace | 0

| aceptada

Respondida
GUIDE patch in wrong plot
doc patch Syntax patch(X,Y,C) patch(X,Y,Z,C) ... patch(ax,___) ... patch(ax,___) creates the patch in...

más de 8 años hace | 0

| aceptada

Respondida
loglog plot ticks + getdata
Someone manually labeled the ticks in the example plot to scale from mV to V; the axis has to be in one set of units; it doesn't...

más de 8 años hace | 1

| aceptada

Respondida
How to level shift a sine wave mathematically?
Sure, it's just a linear scaling from the [-1,1] interval to [minV,maxV] x = sin(2*3.14*f*t); M=[maxV-minV]/2; ...

más de 8 años hace | 1

| aceptada

Respondida
using different colours of points in a biplot
From the doc, h = biplot(coefs,'Name',Value) specifies one or more name/value input pairs and returns a column vector of ...

más de 8 años hace | 0

Respondida
how to write on to particular column in excel, starting from particular row
xlswrite('exp2.xlsx',transpose(duration),1,'E3');

más de 8 años hace | 1

| aceptada

Respondida
add units to colorbar TickLabels (format)
c.Ruler.TickLabelFormat='%g%%'; Unfortunately, you can only know about this by using Yair's function to discover undocumen...

más de 8 años hace | 0

Cargar más