Answered

Loop for randomisation assignment in table columns

% prepare lookup table first... ROWS=cellstr(char('WE', 'BC', 'CCC', 'LB', 'RO', 'NN')).'; ROWS=categorical([ROWS;ROWS([4 5 1 ...

Loop for randomisation assignment in table columns

% prepare lookup table first... ROWS=cellstr(char('WE', 'BC', 'CCC', 'LB', 'RO', 'NN')).'; ROWS=categorical([ROWS;ROWS([4 5 1 ...

12 hours ago | 0

Answered

How do I present an audio signal in a time domain plot using MATLAB, such that the y-axis is in decibel (dB) instead of of a linear scale?

See the attached link https://www.dsprelated.com/freebooks/mdft/Decibels.html In particular, note that "Signal intensity, power...

How do I present an audio signal in a time domain plot using MATLAB, such that the y-axis is in decibel (dB) instead of of a linear scale?

See the attached link https://www.dsprelated.com/freebooks/mdft/Decibels.html In particular, note that "Signal intensity, power...

13 hours ago | 0

Answered

extract elements from signal

Don't create new variables, just x=reshape(x,1000,[]).'; and reference the column of interest. If you create new variables, ...

extract elements from signal

Don't create new variables, just x=reshape(x,1000,[]).'; and reference the column of interest. If you create new variables, ...

1 day ago | 2

| accepted

Answered

export an array to a text file

As documentation for csvwrite says, it is able to write numeric data arrays only; you're trrying to include header data inside t...

export an array to a text file

As documentation for csvwrite says, it is able to write numeric data arrays only; you're trrying to include header data inside t...

1 day ago | 0

Answered

error in figure in matlab

It is, only you have so many points they're all on top of each other instead of being able to distinguish individual points. Yo...

error in figure in matlab

It is, only you have so many points they're all on top of each other instead of being able to distinguish individual points. Yo...

2 days ago | 1

Answered

Smart import of random files

"When the instrument creates its output, this is in .dat." AHA! So you created the problem with the spreadsheet yourself, not ...

Smart import of random files

"When the instrument creates its output, this is in .dat." AHA! So you created the problem with the spreadsheet yourself, not ...

3 days ago | 0

Answered

Smart import of random files

c=readcell('Input_type_1.xlsx'); % read as cellstr array c=c(~cellfun(@(c)all(ismissing(c)),c,'Unifo...

Smart import of random files

c=readcell('Input_type_1.xlsx'); % read as cellstr array c=c(~cellfun(@(c)all(ismissing(c)),c,'Unifo...

3 days ago | 0

Answered

Smart import of random files

Save the file as a .csv instead of .xlsx. May have to coerce Excel to not double-quote the strings; I presume there's a way but...

Smart import of random files

Save the file as a .csv instead of .xlsx. May have to coerce Excel to not double-quote the strings; I presume there's a way but...

3 days ago | 0

Answered

Location of plot for subplot(2,2,3)

The logic is sound but as Steven L points out, it would break existing code going back to the beginning of time so TMW will neve...

Location of plot for subplot(2,2,3)

The logic is sound but as Steven L points out, it would break existing code going back to the beginning of time so TMW will neve...

3 days ago | 0

Answered

Describe to plots in one line in legend

Found a few minutes -- Actually works better than I had expected... hL=plot(abs(randn(10,4))); set(hL(1:2),{'color'},{'r'}) s...

Describe to plots in one line in legend

Found a few minutes -- Actually works better than I had expected... hL=plot(abs(randn(10,4))); set(hL(1:2),{'color'},{'r'}) s...

4 days ago | 2

Answered

How to plot values in lower and higher x-values with putting a break in the plot for middle x-values?

MATLAB doesn't know about broken axes, unfortunately. You might explore the FEX and see if there are any user submissions ther...

How to plot values in lower and higher x-values with putting a break in the plot for middle x-values?

MATLAB doesn't know about broken axes, unfortunately. You might explore the FEX and see if there are any user submissions ther...

6 days ago | 0

Answered

Performing formulas on .mat files in MATLAB

You don't tell us much to go on, but the averaging is simple -- you just have to have a way to find which column(s) are in the f...

Performing formulas on .mat files in MATLAB

You don't tell us much to go on, but the averaging is simple -- you just have to have a way to find which column(s) are in the f...

7 days ago | 0

Answered

Create a new row in a loop

f1=10; f2=50; coherence=cell(numel(f1:f2),numel(three_d_trials)); j=0; for freq=f1:f2 j=j+1; for coherence_index = 1:le...

Create a new row in a loop

f1=10; f2=50; coherence=cell(numel(f1:f2),numel(three_d_trials)); j=0; for freq=f1:f2 j=j+1; for coherence_index = 1:le...

8 days ago | 1

| accepted

Answered

Plot a normal figure and animatedline together onthe same figure

... % I want also to plot the following in the same figure % I want the graph to apear in full in the begining not as an anima...

Plot a normal figure and animatedline together onthe same figure

... % I want also to plot the following in the same figure % I want the graph to apear in full in the begining not as an anima...

9 days ago | 0

| accepted

Answered

plotting live data from a sensor

You are plotting only one point at a time and without having executed a hold on instruction, each call to plot creates a new lin...

plotting live data from a sensor

You are plotting only one point at a time and without having executed a hold on instruction, each call to plot creates a new lin...

9 days ago | 0

| accepted

Answered

How can I augment a toolbox to improve its capabilities?

Don't have the TB in Q? so can't go look to see, but if it is an m-file, there are two ways -- you can just edit the copy in pla...

How can I augment a toolbox to improve its capabilities?

Don't have the TB in Q? so can't go look to see, but if it is an m-file, there are two ways -- you can just edit the copy in pla...

9 days ago | 0

Answered

making a vector of cells

Probably good choice would be to convert the country string/column in the table into a categorical variable; makes for looking f...

making a vector of cells

Probably good choice would be to convert the country string/column in the table into a categorical variable; makes for looking f...

10 days ago | 1

| accepted

Answered

XLSread - multiple sheets

xlsread has been deprecated; use readcell, readmatrix, readtable instead depending on how you want the data returned and the con...

XLSread - multiple sheets

xlsread has been deprecated; use readcell, readmatrix, readtable instead depending on how you want the data returned and the con...

11 days ago | 1

Answered

How can i fix this error?

NB the following ouput: Input data successfully read. Time Series data divided to 80% Train data and 20% Test data Time Serie...

How can i fix this error?

NB the following ouput: Input data successfully read. Time Series data divided to 80% Train data and 20% Test data Time Serie...

11 days ago | 0

Answered

How to read a .txt file in matlab ?

The file is irregular -- there are 9 elements in first record and only eight (8) in second. Besides that, they're inconsistent ...

How to read a .txt file in matlab ?

The file is irregular -- there are 9 elements in first record and only eight (8) in second. Besides that, they're inconsistent ...

11 days ago | 1

| accepted

Answered

split wav file based on txt file (two vectors - start time and duration)

That only would take basic math operations to turn the start times and durations into indices into the the .wav file based on th...

split wav file based on txt file (two vectors - start time and duration)

That only would take basic math operations to turn the start times and durations into indices into the the .wav file based on th...

12 days ago | 1

Answered

How can i multiply every row to row values?

>> A=reshape(1:9,3,[]) A = 1.00 4.00 7.00 2.00 5.00 8.00 3...

How can i multiply every row to row values?

>> A=reshape(1:9,3,[]) A = 1.00 4.00 7.00 2.00 5.00 8.00 3...

12 days ago | 0

| accepted

Answered

How can I calculate Kurtosis of Sound data?

Kin=arrayfun(@(i1,i2)kurtosis(X(i1:i2)),iStart,iEnd); where X are your data and the two indexing arrays above for the "in group...

How can I calculate Kurtosis of Sound data?

Kin=arrayfun(@(i1,i2)kurtosis(X(i1:i2)),iStart,iEnd); where X are your data and the two indexing arrays above for the "in group...

12 days ago | 0

Answered

Plotting data from struct

Couple ways of many... XY=reshape([pop.Cost],2,[]).'; plot(XY(:,1),XY(:,2)) or tpop=struct2table(pop); plot(tpop.Cost(:,1),...

Plotting data from struct

Couple ways of many... XY=reshape([pop.Cost],2,[]).'; plot(XY(:,1),XY(:,2)) or tpop=struct2table(pop); plot(tpop.Cost(:,1),...

15 days ago | 2

| accepted

Answered

How to create code that runs on all columns?

"I have a data set of 10583x3352 single ... I need to averge every 167 rows into 1 row for every column." N=167; ...

How to create code that runs on all columns?

"I have a data set of 10583x3352 single ... I need to averge every 167 rows into 1 row for every column." N=167; ...

15 days ago | 1

| accepted

Answered

Creating new vectors containing values based on for loop outcome.

vals=interp1(a,a,b,'nearest','extrap'); For above a,b: >> vals vals = 3520.00 7650.00 7650.00 1250....

Creating new vectors containing values based on for loop outcome.

vals=interp1(a,a,b,'nearest','extrap'); For above a,b: >> vals vals = 3520.00 7650.00 7650.00 1250....

16 days ago | 0

| accepted

Answered

Normalization of Power Spectral Density

It's to make the output amplitude consistent regardless of the frequency resolution of the measurement. See https://community.s...

Normalization of Power Spectral Density

It's to make the output amplitude consistent regardless of the frequency resolution of the measurement. See https://community.s...

16 days ago | 1

Answered

How can I correctly use the parenthesis and write equations

Pd=Pc*((1+(k-1)/2*ac^2*Vpr^2)^(k/(K-1))-1); Which inputs might be vectors, if any, would determine where and if need dot operat...

How can I correctly use the parenthesis and write equations

Pd=Pc*((1+(k-1)/2*ac^2*Vpr^2)^(k/(K-1))-1); Which inputs might be vectors, if any, would determine where and if need dot operat...

17 days ago | 0

Answered

How do I make a histogram using value - count pairs?

histogram('categories',categorical(M(:,1)),'bincounts',M(:,2)) to match the number of elements in x,y. Otherwise, have to ...

How do I make a histogram using value - count pairs?

histogram('categories',categorical(M(:,1)),'bincounts',M(:,2)) to match the number of elements in x,y. Otherwise, have to ...

17 days ago | 2

| accepted

Answered

Changing the name of the sheet in excel during a loop for

Each workbook just has one sheet that is to be named with the trailing sequence of the filename? That should be pretty simple, ...

Changing the name of the sheet in excel during a loop for

Each workbook just has one sheet that is to be named with the trailing sequence of the filename? That should be pretty simple, ...

19 days ago | 0

| accepted