Answered
Error using readtable (line 318) Matlab R2021a
t=readtable('sub_1.xlsx'); head(t) t=readtable('sub_1.xlsx','numheaderlines',0,'readvariablenames',1); head(t) Seems just fi...

2 years ago | 0

Answered
how to type word to the legend left?
hL=plot(randn(10,2)); hLg=legend('Std','Avg'); %pos=hLg.Position; %pos(1)=pos(1)-0.1; %hA=annotation('textbox',pos,'String',...

2 years ago | 2

| accepted

Answered
semilogx() - x-axis - Increase scaling for lower frequencies - compress higher frequencies
The issue isn't the plotting scaling; it's the data content. Each of the triangular-looking traces in the reference plot goes f...

2 years ago | 0

| accepted

Answered
How to resort every column of a 3d matrix?
L=-180:60:180 wrapTo360(L) [~,ix]=sort(ans) M=[1:3].*L.'; M=cat(3,M,2*M) M(ix,:,:) sortrows doesn't operate on 3D arrays s...

3 years ago | 0

Answered
discrepancy between the p value obtained in a ttest2 on mac vs windows
Simply differences in underlying OS/compiler floating point rounding/underflow. Certainly 10^-49 (or 10^-16 or even 10^-10) is ...

3 years ago | 1

Answered
Why low pass filtering requires long duration time signals?
It's pretty obvious why a lowpass filter would need longer time -- as the cutoff frequency is lowered, the output of the filter ...

3 years ago | 0

Answered
Default argument expression with multiple outputs
Multiple output arguments must be unique variable names; just define the default for the specific name and it will refer to the ...

3 years ago | 0

Answered
How can I sum a number of terms as a polynomial?
"Dead ahead" straightforward would be S=0; for i=1:n S=S+x^i/factorial(i-1); end Alternatively, vectorized could be i=1:...

3 years ago | 1

| accepted

Answered
Convert UNIX NanoSeconds to DTG in Milliseconds
Ah! That simplifies the problem immensely; you've already passed the hard part. To do the initial request to sum over millisec...

3 years ago | 0

Answered
Extract some rows of the matrix with the find command
Perfect application for a little utility function I keep around -- as a sidelight, I create and add to my MATLABPATH a "Utilitie...

3 years ago | 0

Answered
How to use ActiveX to change MS Word Table properties
I've only done any extensive COM with Excel so I don't know the Word object model at all, but the biggest thing to remember is t...

3 years ago | 1

| accepted

Answered
Fastest way to load data.
save does compression by default now which takes time as you've discovered. The absolute fastest albeit somewhat less convenien...

3 years ago | 0

Answered
determine within cell the coordinates (rows/columns) having equal 3 numbers
[r,c]=find(cellfun(@(c)all(c==c(1)),out)); If there are none, the above will return [] empty results; taking off the find() wil...

3 years ago | 0

| accepted

Answered
Why is the MATLABDriver name an empty string when I use ividriverlist?
https://www.keysight.com/us/en/lib/software-detail/driver/analog-demod--xseries-signal-analyzers-ivi-and-matlab-instrument-drive...

3 years ago | 0

Answered
Importing .dat data and creating a matrix
"...that data and limit it by four points - creating a matrix - as follows: (11,5).....(21,5) (11,13)....(21,13)" I don't fo...

3 years ago | 0

Answered
Error encountered when using Datastores on non-rectangular data sets
function bigDataTest(fileLoc) % This function takes in a folder and extracts all the data into MATLAB ds=spreadsheetDatastor...

3 years ago | 0

Answered
Running same code, same Matlab version (2021b) on difference computers (8 different types) 7 produce same results only one is different.
There may yet be differences in the supporting runtime libraries that have been loaded on various machines by different software...

3 years ago | 0

Answered
Create Mex files for Matlab, from .FOR files of Fortran
Which OS? For Linux, the GNU Fortran compiler is supported, for Windows and Mac only a recent version of the Intel compiler is ...

3 years ago | 0

Answered
calculate sum month and annual
Read up on retime and timetable which lead into readtable and table2timetable All are "modern" MATLAB tools; the time-honored a...

3 years ago | 2

| accepted

Answered
how do i add line to a pie graph
subplot(2,2,1) txt=string({['Avoids' newline 'Objects'];['Middle of' newline 'sidewalk'];['Stops' newline 'Often']}); normal_b...

3 years ago | 0

Answered
Help using grid in nexttile and tiledlayout
The two lines set(gca,'YTick',[]); set(gca,'XTick',[]); remove the tick marks and thereby the ticklabels. Remove those and t...

3 years ago | 0

Answered
Modify the color of a scatter3 plot
https://www.mathworks.com/matlabcentral/answers/233084-changing-color-of-the-points-in-scatter3?s_tid=answers_rc1-3_p3_MLT#answe...

3 years ago | 0

Answered
How to fit lognormal distribution to a dataset which contains some zero values?
One analysis technique for daily rainfall modeling divides the problem into two parts -- a "wet-day" model that predicts rainfal...

3 years ago | 0

Answered
How to match the colors in the colorbars across two plots such that the datapoints can be inferred consistently?
Be easier if you had attached the code to generate the figures so could mung on it directly, but something like % create first ...

3 years ago | 0

Answered
FFT of the resultant vector of an accelerometer
The x,y,z data already have a direction; it depends upon whether you want the individual components or the overall magnitude and...

3 years ago | 1

| accepted

Answered
Error trying to fit data to gaussian function: Inf computed by model function, fitting cannot continue
d1=readmatrix('data_working.txt'); d2=readmatrix('data_error.txt'); plot([d1 d2]), xlim([1 numel(d1)]), legend('Working','Erro...

3 years ago | 1

Answered
Is it possible to create a bar graph with different x-Axis scale/labeling?
Set the first/last x values to min(x)-2/max(x)+2, respectively, then set the ticklabels for those two manually. y = [2 2 3; 2 5...

3 years ago | 0

| accepted

Answered
How can I wide the space between curves in the figure and between the numbers on the curves?
The only thing that can separate the lines more would be to have fewer of them; the data are what they are as far as the magnitu...

3 years ago | 0

| accepted

Answered
Matlab argument validation either specific vector size or empty
So far, I've found the arguments block more trouble than simply handling the conditions explicitly for something relatively simp...

3 years ago | 0

Answered
How to plot feature importance on x-axis and variable names on y-axis?
See barh and particularly <the example>. Use the second optional output from sort to get the order of the variables when you so...

3 years ago | 0

| accepted

Load more