Answered

Compare matrix element without loops

Not w/o zero loops, think not, but can reduce to one... idx=1:nG; % working index array for element logical lookup/e...

Compare matrix element without loops

Not w/o zero loops, think not, but can reduce to one... idx=1:nG; % working index array for element logical lookup/e...

21일 ago | 1

| accepted

Answered

present decimal values in a pie graph

... for i = 1 ; length(num) % ";" should be ":" num(i) = ((num(i)/sum(num))*100); end Use Matlab array syntax ...

present decimal values in a pie graph

... for i = 1 ; length(num) % ";" should be ":" num(i) = ((num(i)/sum(num))*100); end Use Matlab array syntax ...

22일 ago | 0

| accepted

Answered

Interpolate data with 2 variables

Your data are pretty sparse over the 2D space but you can try F=scatteredInterpolant(S,T,F); f=F(s,t); where S,T,F are your d...

Interpolate data with 2 variables

Your data are pretty sparse over the 2D space but you can try F=scatteredInterpolant(S,T,F); f=F(s,t); where S,T,F are your d...

22일 ago | 0

| accepted

Answered

Multiple Curve intersection plot

Actually, after looking at the drawings some more, I realize you did supply enough originally to make an initial pass at it... ...

Multiple Curve intersection plot

Actually, after looking at the drawings some more, I realize you did supply enough originally to make an initial pass at it... ...

23일 ago | 0

Answered

Convert datetime that's not in Matlab format to a matlab format datetime

TZ offsets are recognized in ML datetime -- your string can be converted as: s='2014-12-13T18:45:00+00:00'; >> datetime(s,'Inp...

Convert datetime that's not in Matlab format to a matlab format datetime

TZ offsets are recognized in ML datetime -- your string can be converted as: s='2014-12-13T18:45:00+00:00'; >> datetime(s,'Inp...

23일 ago | 1

| accepted

Answered

horizontal concatenate a datetime structure to a table array

I can't tell which data it is you're trying to piece together, but from the OrginalData.mat you posted in the previous Q? on dat...

horizontal concatenate a datetime structure to a table array

I can't tell which data it is you're trying to piece together, but from the OrginalData.mat you posted in the previous Q? on dat...

24일 ago | 1

| accepted

Answered

remove table header row

Should show your work when you've tried something that seems like should but doesn't...it's really quite a straightforward task-...

remove table header row

Should show your work when you've tried something that seems like should but doesn't...it's really quite a straightforward task-...

24일 ago | 0

| accepted

Answered

date and time format change

>> tst=GBP_USD.Date(1:10); % just a sample set to play with >> datetime(tst,'InputFormat','yyyy-MM-dd''T''HH:mm:ss.SSSS...

date and time format change

>> tst=GBP_USD.Date(1:10); % just a sample set to play with >> datetime(tst,'InputFormat','yyyy-MM-dd''T''HH:mm:ss.SSSS...

24일 ago | 1

| accepted

Answered

Conversion of Categorical to double

To answer the question posed, Data.Column7=double(Data.Column7); but see the comment above -- the better solution would be to...

Conversion of Categorical to double

To answer the question posed, Data.Column7=double(Data.Column7); but see the comment above -- the better solution would be to...

24일 ago | 1

Answered

Conversion of Categorical to double

y1 is a grouping variable of which bin each refers to; it will be in the range of 1:N where N is number of unique categories in ...

Conversion of Categorical to double

y1 is a grouping variable of which bin each refers to; it will be in the range of 1:N where N is number of unique categories in ...

24일 ago | 0

| accepted

Answered

how to compare two arrays

O=zeros(size(A)); for i=1:size(A,2) O(:,i)=interp1(B(:,i),B(:,i),A(:,i),'next','extrap'); end

how to compare two arrays

O=zeros(size(A)); for i=1:size(A,2) O(:,i)=interp1(B(:,i),B(:,i),A(:,i),'next','extrap'); end

24일 ago | 0

| accepted

Answered

Sorting a mixed text-numeric matrix (cell array) by one of its (numeric) columns

t=readtable(fileName,'readvariablenames',1); t.sort=rand(height(t),1); [~,ix]=sort(t.sort); t=t(ix,:);

Sorting a mixed text-numeric matrix (cell array) by one of its (numeric) columns

t=readtable(fileName,'readvariablenames',1); t.sort=rand(height(t),1); [~,ix]=sort(t.sort); t=t(ix,:);

24일 ago | 1

| accepted

Answered

How to find common calendar of three matrices?

ABC=[A;B;C]; d=datetime(ABC(:,1:3)); g=findgroups(d); D=splitapply(@(x) {vertcat(x)},ABC,g); D=cell2mat(D(cellfun(@(c)size(c...

How to find common calendar of three matrices?

ABC=[A;B;C]; d=datetime(ABC(:,1:3)); g=findgroups(d); D=splitapply(@(x) {vertcat(x)},ABC,g); D=cell2mat(D(cellfun(@(c)size(c...

24일 ago | 0

| accepted

Answered

how to find a non affected rank in a vector column

Probably for such a case as written for j=1:4 try set(h_leg(j),fontsize,12); catch end end will solve the probl...

how to find a non affected rank in a vector column

Probably for such a case as written for j=1:4 try set(h_leg(j),fontsize,12); catch end end will solve the probl...

25일 ago | 1

| accepted

Answered

How to stop on a variable getting a specific value?

dbstop in file at if expression is best you can do I think...you don't have to manually insert the breakpoint at every line but...

How to stop on a variable getting a specific value?

dbstop in file at if expression is best you can do I think...you don't have to manually insert the breakpoint at every line but...

25일 ago | 0

| accepted

Answered

Why does matlab allow array indexing by a string by converting them into ascii codes?

Why? Because it retains consistency across data types of char() being simply an array of byes. Indexing by alphabetical inde...

Why does matlab allow array indexing by a string by converting them into ascii codes?

Why? Because it retains consistency across data types of char() being simply an array of byes. Indexing by alphabetical inde...

27일 ago | 1

Answered

uigetfile for multiple type problem

Gotta' have good eyes in reading the documentation...use uigetfile({'abc*.mat';'*.dat'}) instead--a column instead of row vect...

uigetfile for multiple type problem

Gotta' have good eyes in reading the documentation...use uigetfile({'abc*.mat';'*.dat'}) instead--a column instead of row vect...

27일 ago | 0

| accepted

Answered

How to concatenate k vectors together without knowing the value of k ?

"... I have to do all these operations in one line in the max function" Well, no, not really -- that's a restriction you've pla...

How to concatenate k vectors together without knowing the value of k ?

"... I have to do all these operations in one line in the max function" Well, no, not really -- that's a restriction you've pla...

27일 ago | 1

Answered

How to add x-axis in the bottom or in the top of a figure?

Indeed, why after 30 years TMW hasn't built parallel universe for it is simply incomprehensible, I agree. It isn't all that ha...

How to add x-axis in the bottom or in the top of a figure?

Indeed, why after 30 years TMW hasn't built parallel universe for it is simply incomprehensible, I agree. It isn't all that ha...

27일 ago | 1

| accepted

Answered

How can i determine last infection point of a vector?

For the type of figure as shown, simple difference will work... >> d=[0 diff(A)]; >> A(d>4) ans = 173 >> where the '4'...

How can i determine last infection point of a vector?

For the type of figure as shown, simple difference will work... >> d=[0 diff(A)]; >> A(d>4) ans = 173 >> where the '4'...

27일 ago | 1

| accepted

Answered

i need to delete a zero from a single row 10 column vector

As we've covered the other cases pretty thoroughly... For the specific input vector OP showed where it is almost certain it is ...

i need to delete a zero from a single row 10 column vector

As we've covered the other cases pretty thoroughly... For the specific input vector OP showed where it is almost certain it is ...

27일 ago | 0

Answered

fplot command what is the default resolution ?

clear x f=@(x) 3*exp(-x).*sin(x); fplot(f,[0 8],'b') will produce the same plot -- fplot doesn't use your x array at all; it ...

fplot command what is the default resolution ?

clear x f=@(x) 3*exp(-x).*sin(x); fplot(f,[0 8],'b') will produce the same plot -- fplot doesn't use your x array at all; it ...

27일 ago | 0

Answered

How to fix the ticklabels - time series analysis?

Clearly, the ticklabels you wrote are (1:5000)/20. The first label is 0.05 --> 1/20, the second 0.10 --> 2/20, etc., etc., ......

How to fix the ticklabels - time series analysis?

Clearly, the ticklabels you wrote are (1:5000)/20. The first label is 0.05 --> 1/20, the second 0.10 --> 2/20, etc., etc., ......

28일 ago | 1

| accepted

Answered

How can i plot raw eeg data

You have to load the library first...see the example code in the documenation for checking...use your wanted library name, path ...

How can i plot raw eeg data

You have to load the library first...see the example code in the documenation for checking...use your wanted library name, path ...

28일 ago | 0

Answered

Difference between readmatrix() and readtable()

It appears readmatrix is limited to returning one type of data in the output array as the 'OutputType' named parameter is limite...

Difference between readmatrix() and readtable()

It appears readmatrix is limited to returning one type of data in the output array as the 'OutputType' named parameter is limite...

29일 ago | 1

| accepted

Answered

How to extract the data lines from a large text file which contains combined numeric lines and text lines

Basic outline is as follows... fid=fopen('OneLineData.dat'); data=[]; l=fgetl(fid); while ~feof(fid) if contains(l,'SOFM ...

How to extract the data lines from a large text file which contains combined numeric lines and text lines

Basic outline is as follows... fid=fopen('OneLineData.dat'); data=[]; l=fgetl(fid); while ~feof(fid) if contains(l,'SOFM ...

30일 ago | 0

| accepted

Answered

How to read mixed delimited data from a text file?

If the file is tab-delimited, the spaces won't matter... data=dlmread(fullfile('yourdirectory','yourfile.txt'),'\t'); % read t...

How to read mixed delimited data from a text file?

If the file is tab-delimited, the spaces won't matter... data=dlmread(fullfile('yourdirectory','yourfile.txt'),'\t'); % read t...

약 1달 ago | 0

Answered

How can I erase Sheet1 Sheet2 and Sheet3 in excel file using writetable function in matlab?

Modifying workbook properties isn't what writetable does--it just writes to a given sheet, creating one of that name if it doesn...

How can I erase Sheet1 Sheet2 and Sheet3 in excel file using writetable function in matlab?

Modifying workbook properties isn't what writetable does--it just writes to a given sheet, creating one of that name if it doesn...

약 1달 ago | 0

Answered

am trying to find the first and second derivates of a set of data points I've imported

That's essentially trivial file that data=csvread('data_10.csv'); data(:,2)=[nan;diff(data(:,1))]; % first difference...

am trying to find the first and second derivates of a set of data points I've imported

That's essentially trivial file that data=csvread('data_10.csv'); data(:,2)=[nan;diff(data(:,1))]; % first difference...

약 1달 ago | 0

Answered

Function handle not rechecking if statement

tf_f = @(T,Y) isempty(p_f(T,Y)); if tf_f(T,Y) == 1 && bottom_f(Y) > p21top_f(T) elseif tf_f(T,Y) == 1 && top_f(Y) < p21top_f(...

Function handle not rechecking if statement

tf_f = @(T,Y) isempty(p_f(T,Y)); if tf_f(T,Y) == 1 && bottom_f(Y) > p21top_f(T) elseif tf_f(T,Y) == 1 && top_f(Y) < p21top_f(...

약 1달 ago | 0