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

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

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

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

18 hours 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)...

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

1 day 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 = ...

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

3 days ago | 0

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

3 days ago | 0

Answered

Please explain what this error is...

That's pretty straightforward problem and the error is quite simple to fix -- Your function definition line is function [eq1,e...

Please explain what this error is...

That's pretty straightforward problem and the error is quite simple to fix -- Your function definition line is function [eq1,e...

4 days ago | 1

| accepted

Answered

My polyfit function is displaying NaN

>> log10(0) ans = -Inf >> You can't do that!!! plot() and friends silently ignore NaN, +/-Inf so you don't see the zero ...

My polyfit function is displaying NaN

>> log10(0) ans = -Inf >> You can't do that!!! plot() and friends silently ignore NaN, +/-Inf so you don't see the zero ...

4 days ago | 0

Answered

Object oriented Programming problem

Don't need to save in the function with that name, just the output variable name chosen for the return value in the function def...

Object oriented Programming problem

Don't need to save in the function with that name, just the output variable name chosen for the return value in the function def...

4 days ago | 1

Answered

I want to Display two matrices next to each other with some space between them

disp(table(Iapp,I,'VariableNames',{'Approximated','Exact'})) Salt to suit...

I want to Display two matrices next to each other with some space between them

disp(table(Iapp,I,'VariableNames',{'Approximated','Exact'})) Salt to suit...

4 days ago | 1

| accepted

Answered

Trying to print a vector.

fprintf(doc,['k0 = ' repmat('%.3f ',1,numel(k0)) '.'],k0);

Trying to print a vector.

fprintf(doc,['k0 = ' repmat('%.3f ',1,numel(k0)) '.'],k0);

4 days ago | 1

| accepted

Answered

How to import Table and column header from two diffrent files?

W/o an example to confirm but from the description alone something like: tData=readtable('thedatafile.csv'); hdrs=readcell('th...

How to import Table and column header from two diffrent files?

W/o an example to confirm but from the description alone something like: tData=readtable('thedatafile.csv'); hdrs=readcell('th...

4 days ago | 0

Answered

Change colors of individual strings of a figure

Well, it'll take a fair amount of detailed coding, but it can be done...as a crude illustration try the following code... close...

Change colors of individual strings of a figure

Well, it'll take a fair amount of detailed coding, but it can be done...as a crude illustration try the following code... close...

4 days ago | 1

| accepted

Answered

Why is readcell not functioning as expected?

If the creating and reading routines don't have some sort of semaphore arrangment to let the one know the file is closed it's po...

Why is readcell not functioning as expected?

If the creating and reading routines don't have some sort of semaphore arrangment to let the one know the file is closed it's po...

5 days ago | 0

Answered

Axis ticks and colorbar labels in bold (heatmap)?

Another case where TMW is too clever by far in creating an opaque graphics object -- you have to use the hidden properties to fi...

Axis ticks and colorbar labels in bold (heatmap)?

Another case where TMW is too clever by far in creating an opaque graphics object -- you have to use the hidden properties to fi...

5 days ago | 0

| accepted

Answered

Round Datetime to certain minutes

interp1 will work... dt=datetime(2020,11,18,00,1+[0:30].',0); % sample datetime array dt20=datetime(2020,11,17,0,[20:30...

Round Datetime to certain minutes

interp1 will work... dt=datetime(2020,11,18,00,1+[0:30].',0); % sample datetime array dt20=datetime(2020,11,17,0,[20:30...

6 days ago | 0

| accepted

Answered

How do i add a seed

See <Controlling-random-number-generation> for discussion and links to rng function if it is needed to modify default seed to be...

How do i add a seed

See <Controlling-random-number-generation> for discussion and links to rng function if it is needed to modify default seed to be...

7 days ago | 0

Answered

How to read gaps from an Excel in MATLAB

It's readmatrix probably that's the problem as it is designed for matrix input and you have what looks like two (or several) mat...

How to read gaps from an Excel in MATLAB

It's readmatrix probably that's the problem as it is designed for matrix input and you have what looks like two (or several) mat...

7 days ago | 0

| accepted

Answered

Reduce loops to Vectors in Viola Jones Algorithm

I don't have the time right now, but the two inner loops should be replaceable by filter2 or conv2. NB: filter2 has an internal...

Reduce loops to Vectors in Viola Jones Algorithm

I don't have the time right now, but the two inner loops should be replaceable by filter2 or conv2. NB: filter2 has an internal...

9 days ago | 0

Answered

How would I be able to output ID's that satisfied an if statement?

Use logical indexing, "the MATLAB way". LIMIT=50; % don't put magic numbers inside code; use variables so can change ...

How would I be able to output ID's that satisfied an if statement?

Use logical indexing, "the MATLAB way". LIMIT=50; % don't put magic numbers inside code; use variables so can change ...

14 days ago | 0

Answered

Two cell arrays indexing

C=cellfun(@(a,b)b(a),A,B,'UniformOutput',false); It's just logical indexing in a background loop under the guise of cell addres...

Two cell arrays indexing

C=cellfun(@(a,b)b(a),A,B,'UniformOutput',false); It's just logical indexing in a background loop under the guise of cell addres...

15 days ago | 0

| accepted

Answered

How to plot over histogram function

>> figure(2) [h] = histogram(norm,100); ... Error using norm Not enough input arguments. >> Your code even if fix the abo...

How to plot over histogram function

>> figure(2) [h] = histogram(norm,100); ... Error using norm Not enough input arguments. >> Your code even if fix the abo...

15 days ago | 0

| accepted

Answered

Numeric miscalculation on the 14th decimal place

MATLAB used double precision floating point for calculations which is good to roughly 15 decimal digits. Hence, when you subtra...

Numeric miscalculation on the 14th decimal place

MATLAB used double precision floating point for calculations which is good to roughly 15 decimal digits. Hence, when you subtra...

15 days ago | 2

| accepted

Answered

Please answer! How to use an if function effectively?

colmn_analyze=4; % desired column to compare colmn_target=2; % desired column to set valLimit=2; % limiting val...

Please answer! How to use an if function effectively?

colmn_analyze=4; % desired column to compare colmn_target=2; % desired column to set valLimit=2; % limiting val...

15 days ago | 1

| accepted