Answered

Adding a second x-axis to each plot in a tiled layout / subplot

The tiled layout object is documented as "A tiled chart layout contains an invisible grid of tiles that covers the entire figur...

Adding a second x-axis to each plot in a tiled layout / subplot

The tiled layout object is documented as "A tiled chart layout contains an invisible grid of tiles that covers the entire figur...

etwa 14 Stunden ago | 0

Answered

cell to matrix in matlab

>> X=[{[[2:2:10].' rand(5,1)]},{[[1:2:10].' rand(5,1)]}] X = 1×2 cell array {5×2 double} {5×2 double} >> [X{1}(:,...

cell to matrix in matlab

>> X=[{[[2:2:10].' rand(5,1)]},{[[1:2:10].' rand(5,1)]}] X = 1×2 cell array {5×2 double} {5×2 double} >> [X{1}(:,...

etwa 17 Stunden ago | 0

Answered

Input only numbers from .txt file and store numbers

It would be better to write a more parseable text file, at least with a delimiter if not multiple records... With just highleve...

Input only numbers from .txt file and store numbers

It would be better to write a more parseable text file, at least with a delimiter if not multiple records... With just highleve...

etwa 18 Stunden ago | 0

Answered

How to iterate through the alphabet like Excel does

function rnge=xlsAddr(row,col) % Build Excel cell address from row, column % % RNGE=XLSADDR(ROW,COL) will return an Excel cel...

How to iterate through the alphabet like Excel does

function rnge=xlsAddr(row,col) % Build Excel cell address from row, column % % RNGE=XLSADDR(ROW,COL) will return an Excel cel...

etwa 19 Stunden ago | 0

| accepted

Answered

selecting values between vectors and plot the values

isA=(Ax>Bx); ABx=Bx; ABx(isA)=Ax(isA); plot(ABx,max(Ay,By))

selecting values between vectors and plot the values

isA=(Ax>Bx); ABx=Bx; ABx(isA)=Ax(isA); plot(ABx,max(Ay,By))

ein Tag ago | 0

Answered

FindPeaks() of a 1024 x 116 Matrix

findpeaks only works on vector input; just use a loop and pass each column of your array in turn. There's a fair amount of back...

FindPeaks() of a 1024 x 116 Matrix

findpeaks only works on vector input; just use a loop and pass each column of your array in turn. There's a fair amount of back...

ein Tag ago | 0

| accepted

Answered

How to separate weekends from weekdays from an Excel file in MATLAB?

Well, ya' gotsa' start somewhere! We all were newbies once...give it a shot and see how far you get on your own first... Impor...

How to separate weekends from weekdays from an Excel file in MATLAB?

Well, ya' gotsa' start somewhere! We all were newbies once...give it a shot and see how far you get on your own first... Impor...

ein Tag ago | 0

| accepted

Answered

extract or split data from one column in table into several columns

>> s='250ms,500ms / 95, 101, 106, 107 / Avg: 11_right / | bl | _HLG_MLD | (9) vs. Avg: 11_right | bl | _CG | _LOW (8) / FCL';...

extract or split data from one column in table into several columns

>> s='250ms,500ms / 95, 101, 106, 107 / Avg: 11_right / | bl | _HLG_MLD | (9) vs. Avg: 11_right | bl | _CG | _LOW (8) / FCL';...

2 Tage ago | 0

Answered

Delete data in one table, based upon another table

It would be easier to write working code if we knew the actual format of the variables -- is it really a MATLAB table object or ...

Delete data in one table, based upon another table

It would be easier to write working code if we knew the actual format of the variables -- is it really a MATLAB table object or ...

2 Tage ago | 0

| accepted

Answered

How can I duplicate the array data into a fixed number?

No, you don't have to have the same number of points in both lines to plot them on the same axes. Use plot(x1,y1,x2,y2) or p...

How can I duplicate the array data into a fixed number?

No, you don't have to have the same number of points in both lines to plot them on the same axes. Use plot(x1,y1,x2,y2) or p...

2 Tage ago | 0

Answered

if any command to check table values

We don't have the data and can't see the actual result in context -- although the code snippet posted isn't formatted well, that...

if any command to check table values

We don't have the data and can't see the actual result in context -- although the code snippet posted isn't formatted well, that...

3 Tage ago | 0

Answered

extract numbers form a column

v=sprintf('%d',double([nan;Q(:,1);nan].'==0)); iStrt=strfind(v,'01').'; iEnd=[strfind(v,'10')-1].'; grpsums=arrayfun(@(i1,i2)...

extract numbers form a column

v=sprintf('%d',double([nan;Q(:,1);nan].'==0)); iStrt=strfind(v,'01').'; iEnd=[strfind(v,'10')-1].'; grpsums=arrayfun(@(i1,i2)...

3 Tage ago | 1

| accepted

Answered

Conditional average (need help with speed)

Grouping variables and rowfun to the rescue... tMeans=rowfun(@(x),mean(x,'omitnan'),mytable,'InputVariables','T','GroupingVaria...

Conditional average (need help with speed)

Grouping variables and rowfun to the rescue... tMeans=rowfun(@(x),mean(x,'omitnan'),mytable,'InputVariables','T','GroupingVaria...

4 Tage ago | 0

| accepted

Answered

monts in year sequence, string, matrix

Add the date to a timetable and retime with aggregation-- tt=timetable(datetime(yr,1,1:365).',data); % make timetable of d...

monts in year sequence, string, matrix

Add the date to a timetable and retime with aggregation-- tt=timetable(datetime(yr,1,1:365).',data); % make timetable of d...

4 Tage ago | 1

Answered

How do I changethe label in a compass graph

Well, the above code commented out pax=gca; so the handle to the axes is either undefined or refers to a probably no longer ex...

How do I changethe label in a compass graph

Well, the above code commented out pax=gca; so the handle to the axes is either undefined or refers to a probably no longer ex...

4 Tage ago | 0

Answered

What kind of multiplication is going on here?

The degenerate case of a 1x1 matrix IS a scalar and so '*' reverts to scalar operation. It would be simply too inconvenient i...

What kind of multiplication is going on here?

The degenerate case of a 1x1 matrix IS a scalar and so '*' reverts to scalar operation. It would be simply too inconvenient i...

4 Tage ago | 1

| accepted

Answered

Loop for randomisation assignment in table columns

From above modifications of IA's original using the idea of a lookup table instead of loop... % set path to where the session 1...

Loop for randomisation assignment in table columns

From above modifications of IA's original using the idea of a lookup table instead of loop... % set path to where the session 1...

4 Tage ago | 1

| accepted

Answered

Calculating discharge over multiple years

Use a table or timetable and rowfun with grouping variables...a couple lines of code and an anonymous function will do it. Fo...

Calculating discharge over multiple years

Use a table or timetable and rowfun with grouping variables...a couple lines of code and an anonymous function will do it. Fo...

4 Tage ago | 0

| accepted

Answered

Drop a column from a matrix if one number in that column is less than 30

VAL=30; % don't bury "magic numbers" in code; use variables bigMatrix=bigMatrix(:,all(b...

Drop a column from a matrix if one number in that column is less than 30

VAL=30; % don't bury "magic numbers" in code; use variables bigMatrix=bigMatrix(:,all(b...

4 Tage ago | 0

| accepted

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

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

5 Tage ago | 0

| accepted

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

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

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

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

7 Tage ago | 0

| accepted

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

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

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

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

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

10 Tage ago | 0