Answered

How can I analyse particular portions of an array to use for plotting? Considering dataset of ~1.5 million rows for each variable and ~150,000 locations with 10 values (for each variable) per location

"I’ve imported the data from a table and converted each variable into their own individual arrays,..." That's exactly the wrong...

How can I analyse particular portions of an array to use for plotting? Considering dataset of ~1.5 million rows for each variable and ~150,000 locations with 10 values (for each variable) per location

"I’ve imported the data from a table and converted each variable into their own individual arrays,..." That's exactly the wrong...

1 day ago | 0

Answered

select complex numbers from cell array based on the real part

Well, if you want the max() of the real part, then you'll have to limit to only looking at the real part -- max() for complex re...

select complex numbers from cell array based on the real part

Well, if you want the max() of the real part, then you'll have to limit to only looking at the real part -- max() for complex re...

3 days ago | 0

| accepted

Answered

Put a cell into a title in plot

Sr=regexp(fileread('data.txt'), '\r?\n', 'split') .'; % reads as a string, not numeric for i=1:size(St); ...

Put a cell into a title in plot

Sr=regexp(fileread('data.txt'), '\r?\n', 'split') .'; % reads as a string, not numeric for i=1:size(St); ...

3 days ago | 0

Answered

Avoid +0 when using fprintf %+d

Not w/o some code logic of one form or the other, no. There is no "magic bullet" format descriptor that behaves as desired; as ...

Avoid +0 when using fprintf %+d

Not w/o some code logic of one form or the other, no. There is no "magic bullet" format descriptor that behaves as desired; as ...

5 days ago | 2

| accepted

Answered

How to convert the output of this coding to txt file formate using Matlab?

ix1 = (Xs1-x2).^2+(Ys1-y2).^2+(Zs1-z2).^2 < R2^2; scatter3(Xs1(~ix1),Ys1(~ix1),Zs1(~ix1),20,'r','h','filled','MarkerFaceColor',...

How to convert the output of this coding to txt file formate using Matlab?

ix1 = (Xs1-x2).^2+(Ys1-y2).^2+(Zs1-z2).^2 < R2^2; scatter3(Xs1(~ix1),Ys1(~ix1),Zs1(~ix1),20,'r','h','filled','MarkerFaceColor',...

6 days ago | 1

| accepted

Answered

proportion of gender having health issue

Some other things to explore... hScore=randi(100,100,1)/4; % An artificial dataset... ...

proportion of gender having health issue

Some other things to explore... hScore=randi(100,100,1)/4; % An artificial dataset... ...

6 days ago | 2

Answered

Is there a way to change the range function of xlsread based on a variable input?

Sure (altho it's probably as fast and less hassle to just read read the whole spreadsheet and then just select the results wante...

Is there a way to change the range function of xlsread based on a variable input?

Sure (altho it's probably as fast and less hassle to just read read the whole spreadsheet and then just select the results wante...

7 days ago | 0

Answered

How can one show variable values in legend of a plot?

Just build the desired string array -- num2str works nicely here alto you have to ensure the values are in a column vector to av...

How can one show variable values in legend of a plot?

Just build the desired string array -- num2str works nicely here alto you have to ensure the values are in a column vector to av...

8 days ago | 0

| accepted

Answered

Syntax: var<1d-4

dp=max(max(abs(phi1a-phi1))); if(~(dp>0) & ~(dp<0) ) disp('NaN'); return; end if(dp<1d-4) break; end % THIS LINE could be wr...

Syntax: var<1d-4

dp=max(max(abs(phi1a-phi1))); if(~(dp>0) & ~(dp<0) ) disp('NaN'); return; end if(dp<1d-4) break; end % THIS LINE could be wr...

8 days ago | 3

| accepted

Answered

How do I make a variable that is equal to the position of a row in a table by using the name of that row?

fieldnames is specically documented for struct or Java or COM objects at least thru R2019b; I wasn't aware it would return the ...

How do I make a variable that is equal to the position of a row in a table by using the name of that row?

fieldnames is specically documented for struct or Java or COM objects at least thru R2019b; I wasn't aware it would return the ...

9 days ago | 0

| accepted

Question

Yet Another Excel COM Problem -- SAVEAS

Have a whole bunch of older Excel files that must process -- and for going forward would like to convert them to the current def...

12 days ago | 1 answer | 0

Answered

Error for reading function

You certainly do throw the parentheses around... :) sumenergy2= ((delta_H_T_ref)+ ((delta_Cp)*((T_isoth)-(T_ref))); ...

Error for reading function

You certainly do throw the parentheses around... :) sumenergy2= ((delta_H_T_ref)+ ((delta_Cp)*((T_isoth)-(T_ref))); ...

13 days ago | 0

Answered

graph axes and its scaling

If you haven't, turn your time vector into datetime (if it is actual calendar time) or a duration (if it is elapsed time from so...

graph axes and its scaling

If you haven't, turn your time vector into datetime (if it is actual calendar time) or a duration (if it is elapsed time from so...

15 days ago | 0

Answered

How do I detect a "tab" character in a line of text read by fgetl?

l=fgetl(fid); istab=(l==9); % the fast way... % istab=strfind(l,char(9)); % the char() string stri...

How do I detect a "tab" character in a line of text read by fgetl?

l=fgetl(fid); istab=(l==9); % the fast way... % istab=strfind(l,char(9)); % the char() string stri...

15 days ago | 1

| accepted

Answered

Modifying Figure Y-Axis Exponent Parameter After YTickLabels are Modified

Don't use manual labels on ticks, just don't put ticks at the unwanted places. When write labels, the EponentMode is set to 'Ma...

Modifying Figure Y-Axis Exponent Parameter After YTickLabels are Modified

Don't use manual labels on ticks, just don't put ticks at the unwanted places. When write labels, the EponentMode is set to 'Ma...

16 days ago | 0

| accepted

Answered

About the usage of for, while and return

With the clarification that operations are the same, then data=xlsread('data.xlsx','B1:B86640'); % preliminaries -- define sto...

About the usage of for, while and return

With the clarification that operations are the same, then data=xlsread('data.xlsx','B1:B86640'); % preliminaries -- define sto...

18 days ago | 0

| accepted

Answered

Array loop to find highest value

"Now I want the 5 best values, but I'm afraid if I sort them with the sort function the id's wont match anymore ..." If that's ...

Array loop to find highest value

"Now I want the 5 best values, but I'm afraid if I sort them with the sort function the id's wont match anymore ..." If that's ...

20 days ago | 1

| accepted

Question

Indexing to table subset from unique

Have a fairly complex table that contains, amongst other things, a Formula field (altho what the field is is immaterial to the q...

20 days ago | 0 answers | 0

Answered

I want to plot!!!

You left out some very key information MATLAB told you about... ... contour(x,y,psi); Warning: Matrix is singular to working ...

I want to plot!!!

You left out some very key information MATLAB told you about... ... contour(x,y,psi); Warning: Matrix is singular to working ...

20 days ago | 0

Answered

Knowing the value in the first and second column of an array, what is the corresponding value in the third column?

Use the MATrix LABoratory features of MATLAB instead of explicit loops where can... width = 0.5; height = 0.1; nIntervalsX = ...

Knowing the value in the first and second column of an array, what is the corresponding value in the third column?

Use the MATrix LABoratory features of MATLAB instead of explicit loops where can... width = 0.5; height = 0.1; nIntervalsX = ...

20 days ago | 0

| accepted

Answered

How to perform mathematical operation in columns on certain elements and make the other elements zero??

Don't try to get too fancy...sometimes just deadahead is the simplest and best (and probably fastest, besides)... a=10; ...

How to perform mathematical operation in columns on certain elements and make the other elements zero??

Don't try to get too fancy...sometimes just deadahead is the simplest and best (and probably fastest, besides)... a=10; ...

21 days ago | 0

| accepted

Answered

how to convert the cell to matrix

Presuming the input is a cell array, m... >> cellfun(@(s) sprintf('%d',fliplr(s)),m,'UniformOutput',false) ans = 6×1 cell a...

how to convert the cell to matrix

Presuming the input is a cell array, m... >> cellfun(@(s) sprintf('%d',fliplr(s)),m,'UniformOutput',false) ans = 6×1 cell a...

21 days ago | 0

Answered

How to run a Absolute value for formula when there's a variable?

Because >> y=abs('Temperature'); >> char(y) ans = 'Temperature' >> You passed the literal character string 'Temperatur...

How to run a Absolute value for formula when there's a variable?

Because >> y=abs('Temperature'); >> char(y) ans = 'Temperature' >> You passed the literal character string 'Temperatur...

21 days ago | 1

| accepted

Answered

Interpolation Between Two known data points

You're not looking across the variations in your two variables--another illustration why it's better to not create multiple vari...

Interpolation Between Two known data points

You're not looking across the variations in your two variables--another illustration why it's better to not create multiple vari...

24 days ago | 0

| accepted

Answered

if statement within for within while loop is not fullfilled but loop is exited

if randomizeOrder(randomizeOrder(:,7)==i,5) == randomizeOrder(randomizeOrder(:,7)==i+1,5) == randomizeOrder(randomizeOrder(:...

if statement within for within while loop is not fullfilled but loop is exited

if randomizeOrder(randomizeOrder(:,7)==i,5) == randomizeOrder(randomizeOrder(:,7)==i+1,5) == randomizeOrder(randomizeOrder(:...

25 days ago | 0

Answered

apply function to all fields in a structure array

Why the nested structure? That's where the problem arises---convert to a struct array, S as >> S=F1 S = 1×2 struct array ...

apply function to all fields in a structure array

Why the nested structure? That's where the problem arises---convert to a struct array, S as >> S=F1 S = 1×2 struct array ...

25 days ago | 0

Answered

How to read excel file?

Reading isn't too hard; interpreting what what you have is lacking some information... First, use the detectImportOptions funct...

How to read excel file?

Reading isn't too hard; interpreting what what you have is lacking some information... First, use the detectImportOptions funct...

27 days ago | 0

| accepted

Answered

Sort variables form lowest to largest but by keeping their name

Per usual, the way in MATLABB is to not used explicitly named variables -- use an array and if you need some auxiliary name/id t...

Sort variables form lowest to largest but by keeping their name

Per usual, the way in MATLABB is to not used explicitly named variables -- use an array and if you need some auxiliary name/id t...

28 days ago | 0

Answered

HELP: Why poly11 fit is not fitting my data?

>> zX=(X-mean(X))/std(X); >> zY=(Y-mean(Y))/std(Y); >> f=fit([zX,zY],Z,'poly11') Linear model Poly11: f(x,y) = p00...

HELP: Why poly11 fit is not fitting my data?

>> zX=(X-mean(X))/std(X); >> zY=(Y-mean(Y))/std(Y); >> f=fit([zX,zY],Z,'poly11') Linear model Poly11: f(x,y) = p00...

29 days ago | 0