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

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

ungefär 12 timmar ago | 0

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

getting info from a unique ID in a csv

Power of the MATLAB table comes fore... tElev=readtable('elevatorexample.csv'); FindFloor=2; % the f...

ungefär 12 timmar 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...

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

ungefär 17 timmar 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...

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

ungefär 17 timmar ago | 0

Answered

How to extract data from one column using the data from the two other columns

res=B(ismember(A,C));

How to extract data from one column using the data from the two other columns

res=B(ismember(A,C));

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

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

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

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

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

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

3 dagar ago | 0

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

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

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

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

5 dagar 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',...

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

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

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

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

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

7 dagar ago | 0

| accepted

Answered

draw and add labels for boxplot

boxplot([proposed_MSD.' manual_MSD.' other_MSD.'],'Labels',{'proposed','manual','other'})

draw and add labels for boxplot

boxplot([proposed_MSD.' manual_MSD.' other_MSD.'],'Labels',{'proposed','manual','other'})

7 dagar ago | 0

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

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

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

Creating M histograms from an NxM table on separate plots

... for k=1:width(headers) % k=width(headers) --> one value, the last column figure ...

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

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

10 dagar 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');...

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');...

10 dagar ago | 0

| accepted

Answered

How to fix/steady the position of a counter in plot title.

Use a fixed-width format string to build the string to display... title(num2str(t1(3)*1000,'Simulation time = %8.3f ms')) t1 h...

How to fix/steady the position of a counter in plot title.

Use a fixed-width format string to build the string to display... title(num2str(t1(3)*1000,'Simulation time = %8.3f ms')) t1 h...

10 dagar ago | 0

Answered

Bring some signals to the same start value and end value

Presuming it is to just stretch the shorter to the same time as the longest, something like: y1=randn(size(t1)); Y1=movmean(y1,...

Bring some signals to the same start value and end value

Presuming it is to just stretch the shorter to the same time as the longest, something like: y1=randn(size(t1)); Y1=movmean(y1,...

10 dagar ago | 0

Answered

How to get specific points for certain value from multiple excel files and insert them into the figure as legend?

t=array2table(data,'VariableNames',{'Time','P1','P2','V','S'}); Vtarget=35.4; ix=interp1(t.V,1:height(t),35.4,'nearest') ix =...

How to get specific points for certain value from multiple excel files and insert them into the figure as legend?

t=array2table(data,'VariableNames',{'Time','P1','P2','V','S'}); Vtarget=35.4; ix=interp1(t.V,1:height(t),35.4,'nearest') ix =...

10 dagar ago | 0

Answered

How to change cell colors in uitable

You didn't follow the instructions given at the linked-to Answer. The 'BackgroundColor' property applies to the whole table; yo...

How to change cell colors in uitable

You didn't follow the instructions given at the linked-to Answer. The 'BackgroundColor' property applies to the whole table; yo...

10 dagar ago | 0

Answered

How can I read multiple mat files and perform ttest2 function?

Arrange the name convention so they will sort in the desired sequence and can process by twos -- then d=dir(fullfile('directory...

How can I read multiple mat files and perform ttest2 function?

Arrange the name convention so they will sort in the desired sequence and can process by twos -- then d=dir(fullfile('directory...

11 dagar ago | 0

| accepted

Answered

Error using ==> asind Argument should be real.

Working as documented... ACOSD() Description Y = acosd(X) returns the inverse cosine (cos-1) of the elements of X in degree...

Error using ==> asind Argument should be real.

Working as documented... ACOSD() Description Y = acosd(X) returns the inverse cosine (cos-1) of the elements of X in degree...

11 dagar ago | 1

Answered

what is the easiest way to reduce the lines in the code below?

data=csvread('flowrate.csv'); % Solution 1: Eliminate unwanted column data(:,6)=[]; % Solution 2: Keep desired columns dat...

what is the easiest way to reduce the lines in the code below?

data=csvread('flowrate.csv'); % Solution 1: Eliminate unwanted column data(:,6)=[]; % Solution 2: Keep desired columns dat...

11 dagar ago | 1

| accepted

Answered

Plot specific columns in cell array

for i=1:numel(c28_20chs) hL(i)=plot(c28_20chs{i}(:,3),c28_20chs{i}(:,4)); if i==1, hold on; end if isempty(c28_20chs(i)...

Plot specific columns in cell array

for i=1:numel(c28_20chs) hL(i)=plot(c28_20chs{i}(:,3),c28_20chs{i}(:,4)); if i==1, hold on; end if isempty(c28_20chs(i)...

12 dagar ago | 0

| accepted

Answered

Plot not displaying x axis correctly?

Show us code to prove it, but, from the symptom described you wrote something like: x=-7:7; y=yourfunction(x); plot(y) which...

Plot not displaying x axis correctly?

Show us code to prove it, but, from the symptom described you wrote something like: x=-7:7; y=yourfunction(x); plot(y) which...

12 dagar ago | 0

| accepted

Answered

or() in categorical variable

Because >> or(1,2) ans = logical 1 >> You're apparently looking for >> ismember(financial_status,[1,2]) ans = ...

or() in categorical variable

Because >> or(1,2) ans = logical 1 >> You're apparently looking for >> ismember(financial_status,[1,2]) ans = ...

12 dagar ago | 0

| accepted

Answered

Retrieving Data from User using data tables in Matlab?

gasesab.Gases=categorical(gasesab.Gases); % turn into categorical variable inGas=listdlg('ListString',gasesab.Gases, ... ...

Retrieving Data from User using data tables in Matlab?

gasesab.Gases=categorical(gasesab.Gases); % turn into categorical variable inGas=listdlg('ListString',gasesab.Gases, ... ...

13 dagar ago | 0

| accepted

Answered

Average vector of an array

https://www.mathworks.com/help/matlab/ref/mean.html Look at first example

Average vector of an array

https://www.mathworks.com/help/matlab/ref/mean.html Look at first example

13 dagar ago | 0