Answered
Linear model fit error
x1 = [7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 6.5 8.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5].'; x2 = [12 12 12 12 12 12 12 12 20 20 20 20...

5 years ago | 0

Answered
I am getting error "Conversion to cell from uint8 is not possible." Can anyone please help in debugging this? Thank you for your time.
segmented_images=cell(1,3); did indeed define to be a cell array, but then you wrote segmented_images(k)=colors; segmented_im...

5 years ago | 1

| accepted

Answered
When using listdlg to create a menu, how do you access the user input?
>> cList = {'United Kingdom','Bulgaria','Germany','Greece','Sweden','Netherlands','Spain','Romania','Luxembourg','Poland'}; [in...

5 years ago | 0

| accepted

Answered
Edit a column in a dat file with some header lines and a table
A) goes something like nHeaders=11; % or whatever fidi=fopen(filenameIn,'r'); fido=fopen(filenameOut,'w'); for i=1:nHeaders...

5 years ago | 1

Answered
How to transfer data from a messy .rpt file to an array
>> data=textread('output.rpt','%s','delimiter','\n','headerlines',5) data = 14×1 cell array {'CASE = ""' ...

5 years ago | 1

Answered
Error when fitting polyfit curve
Error is exactly what it says--you wrote: X = categorical({'March','April','May','June','July','August','November'}); M = reor...

5 years ago | 0

| accepted

Answered
Export a Char String to Excel
The example doesn't work as is, exactly... >> res = ['Carreau-Parameter: ';'a = 7521.1446 Pa*s ';'b = 0.10637 s ';'c = 0.7...

5 years ago | 1

| accepted

Answered
How to convert a vector to a string (Matlab2016a)
For what definition of "string"? >> A=1:3; >> num2str(A) ans = '1 2 3' >> num2str(A.') ans = 3×1 char array ...

5 years ago | 0

Answered
Continue Long Statements on Multiple Lines
ix=find(~contains(txt,'Sys')); >> arrayfun(@(ix) join(txt(ix-1:ix),1),ix) ans = 2×1 cell array {'Sys_7899 1=0.21 2=...

5 years ago | 0

Answered
Mean of mutiple variables
d=dir('data*.mat'); % or similar list. Name files so can use appropriate wildcard expression total=0; for i=1:numel(d) ...

5 years ago | 1

| accepted

Answered
How to use fillmissing function within a group ?
>> varfun(@(x) fillmissing(x,'previous'),T,'groupingvariables',{'ID'},'InputVariables',{'amount1','amount2'}) ans = 6×4 tabl...

5 years ago | 0

| accepted

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

5 years ago | 1

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

5 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 >>

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

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

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

5 years ago | 0

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

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

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

5 years ago | 0

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

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

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

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

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

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

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

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

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

5 years ago | 0

Load more