Answered

Inserting Array into Another Array

ix=true(size(a)); ix(x)=false; z(ix,1)=a;

Inserting Array into Another Array

ix=true(size(a)); ix(x)=false; z(ix,1)=a;

alrededor de 9 horas ago | 0

Answered

How to find indices of non duplicate rows in a matrix?

>> A = [1 1 2 2 3 4 5 6 6]; >> [n,b]=histc(A,unique(A)); >> A(ismember(b,find(n==1))) ans = 3.00 4.00 ...

How to find indices of non duplicate rows in a matrix?

>> A = [1 1 2 2 3 4 5 6 6]; >> [n,b]=histc(A,unique(A)); >> A(ismember(b,find(n==1))) ans = 3.00 4.00 ...

alrededor de 10 horas ago | 0

Answered

error converting chars to string

You've previously defined Samples as a cell array (either deliberately or by accident) -- >> Samples={} Samples = 0×0 empty...

error converting chars to string

You've previously defined Samples as a cell array (either deliberately or by accident) -- >> Samples={} Samples = 0×0 empty...

alrededor de 14 horas ago | 0

Answered

Splitting data array into sub arrays

>> SIC=[3301, 4502, 3306, 4602, 4510].'; >> splitapply(@median,SIC,findgroups(fix(SIC/100))) ans = 3303.50 450...

Splitting data array into sub arrays

>> SIC=[3301, 4502, 3306, 4602, 4510].'; >> splitapply(@median,SIC,findgroups(fix(SIC/100))) ans = 3303.50 450...

alrededor de 15 horas ago | 0

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

1 día 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}(:,...

1 día 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...

1 día 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...

1 día 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))

2 días 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...

2 días 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...

2 días 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';...

3 días 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 ...

3 días 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...

3 días 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...

4 días 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)...

4 días 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 días 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 días 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 días 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...

5 días 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...

5 días 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...

5 días 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...

5 días 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 ...

6 días 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...

6 días 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, ...

6 días 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...

7 días 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 días 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 ...

8 días 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...

8 días ago | 0