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

8 years ago | 1

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

8 years ago | 1

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

8 years ago | 0

| accepted

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

8 years ago | 1

| accepted

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 1

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

8 years ago | 0

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

8 years ago | 1

| accepted

Answered
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));

8 years ago | 0

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

8 years ago | 0

Answered
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(...

8 years ago | 4

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 1

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

8 years ago | 1

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 1

| accepted

Answered
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; ...

8 years ago | 1

| accepted

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

8 years ago | 0

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

8 years ago | 1

| accepted

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

8 years ago | 0

Answered
Plot range of values as bars
OK, the |bar| option works pretty easily, actually, with some handle-diving for how things are organized. % first make up ...

8 years ago | 1

Answered
How to create a random permutation that has specific values in a specific place?
Writing multiple sequentially-numbered variables is a bad idea in general but won't try to get into fixing that here...but if we...

8 years ago | 0

Answered
What mean ''All zero sparse''
Yes; pretty easy to just check and see... >> A(3,3)=1; >> S=sparse(A) S = (3,3) 1 >> S(1,:) ans = All ze...

8 years ago | 0

Answered
Converting a string containing a function (t) to a useable variable.
Need to convert string to the function--- >> t=0:pi/8:pi; % predefined t >> s='20*cos(4*t)'; % sample ...

8 years ago | 0

| accepted

Answered
How can i plot mol fraction NO on many combustions cycle?
Can simplify code complexity significantly which helps in both writing and debugging in following line Y1no=1e6*yno(:...

8 years ago | 0

| accepted

Answered
How do I write code to store the data in a textbox using the format (dd/mm/yyyy) the same image as shown.?.
set(handles.DateFind,'String',datestr(setDate, 'dd/mm/yyyy')); where |setDate| is your datenum value. I'd suggest not us...

8 years ago | 0

| accepted

Load more