Respondida
Large format spec statement in textscan
fmt=repmat('%d',1,1025); data=textscan(fid,fmt,... For the second, use the option _N_ multiplier to control the number o...

casi 10 años hace | 0

Respondida
How to add error bars to a semilogy plot?
hAx=axes; % new axes; save handle errorbar(A,B,C,'o') % plot as errorbar hAx.XScale='log' ...

casi 10 años hace | 1

Respondida
Importing Data from Excel
d=dir('*.xlsx'); % return directory list of all Excel files x=[]; for i=1:length(d) x=[x;xlsread(d(i).name,'B:B');...

casi 10 años hace | 0

| aceptada

Respondida
Decimals control to the writetable to txt!
More than likely this is a case of display vis a vis internal storage; in general floating point values can't be stored precisel...

casi 10 años hace | 1

Respondida
Help! My first for-loop plot
_"I can't get the line to show! Where did it go?"_ It didn't "go" anywhere, you never actually plotted it--in if sin(i...

casi 10 años hace | 0

| aceptada

Respondida
1-D interpolation along specified dimension
Not sure who's the independent _x_ value but seems like the vectorized form should work xout=interp1(x,data.',xq); where...

casi 10 años hace | 1

| aceptada

Respondida
How can I convert 8 digit "20171203" date to proper format?
Use the new(ish) _'%D'_ format specifier with *textscan*-- >> d=20171203; >> dt=textscan(num2str(d),'%{YYYYMMdd}D') dt ...

casi 10 años hace | 1

Respondida
Surfl chart; datetime on y-axis, letters on x-axis
Be simpler if you'd attach a subset of the data itself but you've got to give the _X_, _Y_ axes values to plot against to get da...

casi 10 años hace | 0

Respondida
Read a txt file
Use _|'headerlines'|_ named parameter in |*textscan*| is probably the simplest; a loop and |*fgetl*| also works well albeit a li...

casi 10 años hace | 0

| aceptada

Respondida
if statement different answer when input variable vs number
See the FAQ <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F Why is 0.3-0.2-0.1 no...

casi 10 años hace | 1

| aceptada

Respondida
Using Datenum to convert YYYY MM DD HH
dNum = datenum([nineteen_49(:,1:4) zeros(length(nineteen_49),2)]); You missed the second argument to *zeros* in your augmen...

casi 10 años hace | 0

| aceptada

Respondida
coloring by third variable
Sure, just use a set of RGB triplets for the color vector instead of the values. Each row of the matrix specifies an RGB triple...

casi 10 años hace | 0

Respondida
Formatting a single row of data into multiple rows
Data = cell2mat(textscan( fid, '%d', 'delimiter', ';')); % convert to array from cell N=10; ...

casi 10 años hace | 0

Respondida
When export date/time to excel, change the time(mm:ss)..
What's wrong is the confusing nature of what the 'Format' property actually does with |*datetime*| variables; it only affects th...

casi 10 años hace | 0

Respondida
Speeding up search by value in a large vector.
Well, don't know if it's any faster or not but you can try nwset=nwset(nwset(:,1)==prev_idx(i),2); to eliminate the inte...

casi 10 años hace | 0

Respondida
How to delete rows that contain NaN in a table
If the table uses default missing values for the various types (see documentation for the various types; NaN is for numeric) the...

casi 10 años hace | 3

| aceptada

Respondida
fprintf cell array with strings and numbers
... fmt=[repmat('%f,',1,cols1{kk}-1) '%s\n']; % format presuming last is string for i=1:rowsC{kk} fprintf(B{kk},fm...

casi 10 años hace | 0

Respondida
Interpolation by pressure using interp1
Rough outline to get you started... >> S=categorical(cellstr([repmat('B',3,1); repmat('C',5,1)])) % made up a few extras.....

casi 10 años hace | 0

| aceptada

Respondida
Store data into new variable based on condition
Matlab Tutorial (not your problem, but worth noting in general) A=max(size(dataset)); --> length(dataset) which will on...

casi 10 años hace | 0

| aceptada

Respondida
Write vectors of different size in text file
data = [Angle Velocity Distance Acceleration]'; ... where not all vectors are of same length. Doesn't seem to make mu...

casi 10 años hace | 3

| aceptada

Respondida
Is there any other way to code (|n1| |n2|) in matlab..? i couldnot code this single vertical bars ..? it is very simple to look my question but am stuck here.. if i come to know this i will solve my problem...
doc abs Matlab uses | as a logical operator, not in pairs to indicate absolute value (which practice is consonant with virt...

casi 10 años hace | 2

| aceptada

Respondida
Saving .txt file in .mat file
Sure, you can store multiple variables in a single .mat file; just read the .txt file into a cellstr array variable and write bo...

casi 10 años hace | 0

Respondida
sortrows not working with logical column
The doc at the link is addressing an _*array*_ input which array can be one of the various types listed. It isn't describing a ...

casi 10 años hace | 1

| aceptada

Respondida
why the answer is not showing any matrix after applying IF condition?
_"... I cannot find any cell named allCells_array"_ X=sum(Z,2); % will be column vector of sums if all(X>=2) % will be ...

casi 10 años hace | 1

Respondida
Comparing two arrays of different lenght and extracting the ones in common
[~,~,ixzy]=intersect(XY,XYZ(:,1:2),'rows'); xzy=XYZ(ixyz,:); if the values are commensurate in that the XY points must b...

casi 10 años hace | 0

| aceptada

Respondida
plotting with a rectangle
I'd approach it by using the COG and rotation as computed by the simulation and then a transformation from that to the location ...

casi 10 años hace | 0

| aceptada

Respondida
How to find input data that best matches given output data
# f=[freq(1):100000:freq(end)].'; % if want fixed df between ranges use colon instead of linspace # ix=interp1(f1,1:length(f1)...

casi 10 años hace | 0

| aceptada

Respondida
I need more decimal digits than the default for the values of x ...
>> x=(0); for i=1:10; fx=exp(pi*x(i))/3 -1; fxx=pi*exp(pi*x(i))/3; fxxx=pi*pi*exp(pi*x(i))/3; ...

casi 10 años hace | 1

Respondida
How to change the fontname of axes labels when using the latex interpreter
Well, when you change to the LaTeX interpreter from TeX then (as you've learned) _fontname_ and all the similar properties are n...

casi 10 años hace | 3

| aceptada

Respondida
Is it ok to have rounding errors when rounding to integers?
Does appear to be a "quality of implementation" issue. Hadn't ever used it w/ the negative optional argument but looks like doe...

casi 10 años hace | 0

| aceptada

Cargar más