Respondida
Split vector by parts with more evenly distributed length
Consider the following... >> for k=fix(sqrt(L)):-1:2,if rem(L,k)==0,disp([L,k,L/k]),end,end 2184 42 ...

más de 8 años hace | 0

Respondida
Sort raw data from a stream, with more zeros on top
>> [~,ix]=sortrows([sum(Z==0,2) dE],[-1 2]) ix = 1 3 4 5 2 >>

más de 8 años hace | 0

Respondida
Sorting and Equating n-number of least Values in the row to NaN
[~, idx] = sort(A(10,:),'ascend'); % keep the index; don't care about the values really A(10,idx(1:5))=nan; ...

más de 8 años hace | 1

| aceptada

Respondida
How do I make an array of elapsed times?
str = 'April 18, 1995 12:00:00'; t1 = datetime(str,'inputformat','MMM dd, yyyy HH:mm:ss'); stoptime=datetime(stopdate,'i...

más de 8 años hace | 1

Respondida
Split variable length vector by parts
L-length(V); P=17; id2=[repmat(P,1,fix(L/P)) rem(L,P)]; % number elements in cell size P matching L plus remainder ...

más de 8 años hace | 0

| aceptada

Respondida
Is there a better way to write this short function, without the 'for' loop?
mtch=ismembertol(Tbl(:,VarNames),VarVals,Tol); but will be array, not vector and if return only the vector result of |find|...

más de 8 años hace | 0

| aceptada

Respondida
How to draw quiver in a logarithmic axes?
surf(... hAx(1)=gca; % first axes; make semilog in y, do whatever... hAx(2)=axes('position',get(hAx(1),'position')...

más de 8 años hace | 0

Respondida
Variable number of plots in the same figure
Don't make the data arrays with sequential names; instead use arrays (by column per each variable) and then PLOT() can handle th...

más de 8 años hace | 0

Respondida
Finding the Maximum of 6 matrices
The problem is the creation of sequentially named variables instead of using a form of data storage that makes addressing the da...

más de 8 años hace | 0

Respondida
Error using reshape To RESHAPE the number of elements must not change.
Well, if I just make up a .wav file and try your code on it I find [fData,Fs] = audioread('handel.wav'); orig_siz...

más de 8 años hace | 0

Respondida
Problem importing files-- matlab version changes
While unfortunately may not return to see it; I took a little time and recast the function to reduce the duplicated code and cle...

más de 8 años hace | 1

Respondida
Random Sampling of Repeated Numbers in an Array
On the assumption made in above comment... >> [B,ia]=unique(Q); >> isMult3=(NCount==3); >> arrayfun(@(x) randperm(x,1...

más de 8 años hace | 0

Respondida
extract routine data from extra large (~20GB) text file
*ADDENDUM* Attached updated version that incorporates reading multiple atoms in single run; run-time seems essentially linear w...

más de 8 años hace | 1

| aceptada

Respondida
Normalize FFT Signal of ECG data
<https://www.mathworks.com/help/matlab/ref/fft.html#buuutyt-7 <FFT Example>> illustrates normalization of one-sided PSD to retri...

más de 8 años hace | 1

Respondida
Problem importing files-- matlab version changes
OK, the mystery is solv'ed; the root cause is |*uiimport*| with it's "new and improved" flavor in wanting to use |table| class a...

más de 8 años hace | 0

| aceptada

Respondida
How do i create a big line with 3 portions ?
hF=figure; % make new figure, save handle to it X=[0;500;800;1000]; % given X values Y=[0;0;0;0];...

más de 8 años hace | 0

| aceptada

Respondida
reorganize two related matrices in ascending order
[A,ix]=sort(A,2); for i=1:size(A,1), B(i,:)=B(i,ix(i,:)); end Bound to be a way to write the indexing but it's not comin...

más de 8 años hace | 0

Respondida
Error with set difference function
['1.1.1.100';'1.1.1.101';'1.1.1.141'] is a char() array, not cellstr or string Either >> c=cellstr(s) c = 3×1 cell a...

más de 8 años hace | 0

Respondida
How to read data from csv files containing both text and data
'Pends on what you mean, specifically, by 'data'. One of the easiest ways to treat mixed data files if you do want the numeric ...

más de 8 años hace | 3

| aceptada

Respondida
Opposite of Interpolation: reduce size from a very detailed 2D matrix to a less detailed 2D matrix
W/O knowing anything at all about what the data are it's tough to say anything specific but the most obvious is to simply use so...

más de 8 años hace | 0

Respondida
Asking user is they want to save matrix to text file.
While the above will work, |menu| has been deprecated; perhaps use |questdlg| instead... option=questdlg('Save to text file...

más de 8 años hace | 0

Respondida
Assistance in coding needed
One way; may be more better...presuming _X_ is square... is1=(X==1); X(is1 & ~eye(size(X)))=0; Oh!...easy enough if i...

más de 8 años hace | 0

Respondida
How can I move to a specific position in a txt file and write a value there? Target can be a specific word or bites from origin
>> maxim >> type testTriangle.txt #THIS IS MY SCRIPT #IT CALCULATES THE PERIMETER OF A TRIANGLE OF AREA: 18.81 m^2 #THE PE...

más de 8 años hace | 0

Respondida
How to put 2 lines of best fit on a 2D 3 axis plot (x,y,y1)?
bha=polyfit((Qlmin,ha,2); bhn=polyfit((Qlmin,n,2); hold(hAx(1),'on') hLL=plot(Qlmin,polyval(bha(Qlmin)); hold(hAx(...

más de 8 años hace | 0

Respondida
Extracting data from a 3D matrix
Try [A,B]=meshgrid(A,B); % 2D grid of frequency points ix=(abs(A-B)==200); % logic indexing array of locations 200 ...

más de 8 años hace | 0

Respondida
How to use a for loop to iterate through a table?
Not sure I follow what you're after eggsactly but I'll take a fryer... for i = indextable{1,column}:indextable{end,column};...

más de 8 años hace | 2

| aceptada

Respondida
Data import and establish correlation between data
You didn't account for the header line... current=cell2mat(textscan(file1,repmat('%f'1,3),'headerlines',1,'collectoutput',1...

más de 8 años hace | 0

Respondida
Need help with generating a box and whisker plot
Unfortunately, the builtin |boxplot| function only does the whole thing from the raw data; it doesn't have the feature to build ...

más de 8 años hace | 0

Respondida
Difficulties programming coordinates identification
[isHit,whereHit]=ismember(Tile(:,2:3),Traj,'rows'); _isHit_ is T if the tile was touched during the walk; _whereHit_ is the...

más de 8 años hace | 0

Respondida
Problem importing files-- matlab version changes
As for the behavior change, don't know about it; R2016b is last I've yet to install and it also automagically selected only the ...

más de 8 años hace | 0

Cargar más