Respondida
Insert time depending on sample time and measurement points into existing table
In "the MATLAB way", don't use loops where not needed...since you have end points and number, use linspace ST = 3; ...

casi 6 años hace | 1

| aceptada

Respondida
Inserting Array into Another Array
ix=true(size(a)); ix(x)=false; z(ix,1)=a;

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

Respondida
Splitting data array into sub arrays
>> SIC=[3301, 4502, 3306, 4602, 4510].'; >> splitapply(@median,SIC,findgroups(fix(SIC/100))) ans = 3303.50 450...

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 0

Respondida
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}(:,...

casi 6 años hace | 0

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

casi 6 años hace | 0

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

casi 6 años hace | 0

| aceptada

Respondida
selecting values between vectors and plot the values
isA=(Ax>Bx); ABx=Bx; ABx(isA)=Ax(isA); plot(ABx,max(Ay,By))

casi 6 años hace | 0

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 0

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

casi 6 años hace | 1

| aceptada

Respondida
Conditional average (need help with speed)
Grouping variables and rowfun to the rescue... tMeans=rowfun(@(x),mean(x,'omitnan'),mytable,'InputVariables','T','GroupingVaria...

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 1

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

casi 6 años hace | 0

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 2

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 1

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

casi 6 años hace | 0

| aceptada

Cargar más