Answered
Index exceeds the number of array elements (Very odd case)
Well, yes, that can happen but it won't necessarily always, depending upon what the data are in the two arrays. ... [SOCu, ind...

6 years ago | 1

Answered
Plot 2 vectors (different size) on same histogram normalized such that both have total area 1
Use 'Normalization','pdf' instead.

6 years ago | 1

| accepted

Answered
How to find X value of given Y close to zero ?
[~,ix]=min(abs(m),[],'all','linear'); [~,j]=ind2sub(size(m),ix); >> o(j) ans = 340 >>

6 years ago | 0

| accepted

Answered
export txt with text and numers
Does seem as though TMW has ignored such in terms of prepared functions; probably because there is no limit to the possibliliti...

6 years ago | 0

Answered
How to add values in matrix if in a conditions is met?
>> accumarray(findgroups(data(:,1)),data(:,2)) ans = 3.5000 1.5000 4.8000 2.5000 5.4000 2.8000 ...

6 years ago | 0

| accepted

Answered
How to create extra data based on a string cell value?
Read the data into a table instead is probably quite a lot easier. Then use grouping variables to operate over data by whatever...

6 years ago | 0

Answered
readMatrix/for loop issue
MATLAB is case sensitive--the function is readmatrix, not readMatrix

6 years ago | 0

Answered
How do I use use sprtintf for a loop?
Probably the most-asked question of all...don't build the names, use dir d=dir('Monday*.csv'); % better to use fully-qual...

6 years ago | 0

Answered
How can I exclude specific data points from a data file?
Just select the data want (or conversely, remove what don't want)... Fout=1000; ZLim=2.5E6; isOut=(rawData(:,1)==Fout) & (raw...

6 years ago | 0

Answered
Difference between two successive elements in a matrix
D=diff(A(:,2)); ix=find(D>5)+1;

6 years ago | 1

Answered
How to plot two lines with different scales in MATLAB?
So what, specifically did you try and what didn't work? Seems straightforward... t=readtable('t.csv'); plot(t.Date,t.IP) yla...

6 years ago | 0

| accepted

Answered
How to find is between values for 1min datetime delta
>> tlower.Format='Default'; >> tupper.Format='Default'; >> [tlower tupper] ans = 1×2 datetime array 01-Jan-2020 15:18...

6 years ago | 0

| accepted

Answered
histogram with three sets of data
So what have you tried? Did you read the doc for bar and look at examples? XData=categorical({'Category A','Category B','Categ...

6 years ago | 0

| accepted

Answered
getting info from a unique ID in a csv
Power of the MATLAB table comes fore... tElev=readtable('elevatorexample.csv'); FindFloor=2; % the f...

6 years ago | 0

| accepted

Answered
why wont text scan read all rows?
MPG Cylinders displacement horsepower weight acceleration model year origin car name 18 8 307 130 3504 12 70 1 chevrolet chevel...

6 years ago | 0

Answered
matlab Fit the third polynominal
I'm guessing something on the lines of the following would be about the ticket... nProp=listdlg('ListString',{'Ultimate strengt...

6 years ago | 0

Answered
Obtain seperate legend for each contour line
There's no way to make legend use the contour lines directly; there are not any object handles to them; and the legend is global...

6 years ago | 0

| accepted

Answered
Import a CSV file with no header separating numbers from symbols in a table
Gotta' give it a little help...but boy! that's ugleee! :( At least they did use quoted strings. opt=detectImportOptions('Miche...

6 years ago | 0

Answered
How to add a newline after a certain number of characters
function strMultiLines=nCharLine(strtxt, n) fmt=[repmat('%c',1,n) '\n']; strMultiLines=sprintf(fmt,strtxt); end for inpu...

6 years ago | 1

Answered
How to average over different length vectors without excessive for loops?
Use a cellarray to store the results of each trial instead of individual named variables; then means=cellfun(@mean,x);

6 years ago | 0

Answered
how to find index of matrix
Try [row,col]=find (A(:,1)==9 && A(:,3)=5.125) You've got the column indices off -- If you really mean for it to be for A(:,2...

6 years ago | 0

Answered
How can I count the number of times a specific year appears given an x amount of dates
tEQ=readtable('database.csv'); uYr=unique(year(tEQ.Date)); nEq=histc(year(tEQ.Date),uYr); tNEQ=table(uYr,nEq,'VariableNames',...

6 years ago | 0

Answered
How to print some numeric value by using xlabel in subplot?
xlabel(num2str(NC,'NC=%.2f')) Dunno what "attack" above represents. If it's a char variable and wanted as part of the string, ...

6 years ago | 0

Answered
Populating matrix with data from a table
Since have expanded somewhat, will add additional Answer to bring to forefront -- and illustrate couple other things... Above w...

6 years ago | 0

| accepted

Answered
draw and add labels for boxplot
boxplot([proposed_MSD.' manual_MSD.' other_MSD.'],'Labels',{'proposed','manual','other'})

6 years ago | 1

| accepted

Answered
Populating matrix with data from a table
WOWSERS!!! You've got something like 1500 variables!!!??? That's definitely hard to deal with by variable name no matter what ...

6 years ago | 0

Answered
Creating M histograms from an NxM table on separate plots
... for k=1:width(headers) % k=width(headers) --> one value, the last column figure ...

6 years ago | 0

Answered
varfun applied to timetable, how can i keep only 1 of several outputs?
Two ways I see: Write function that wraps polyfit and only returns the slope instead of using anonymous function. Presuming th...

6 years ago | 0

| accepted

Answered
How to get specific points for certain value from multiple excel files and insert them into the figure as legend?
With the added information, I'd do something more like Vtarget=35.4; [files, path] = uigetfile ('.xlsx', 'MultiSelect', 'on');...

6 years ago | 0

| accepted

Load more