Question

Brain freeze re: grouping and recombination

Have two files of correlated data via a categorical variable -- in the first, the name field has been normalized such that can f...

약 14시간 ago | 0 answers | 0

Answered

while/for loop

"know i have to use a for or while loop..." Not with Matlab, no! Use Logical indexing (link) as illustrated...

while/for loop

"know i have to use a for or while loop..." Not with Matlab, no! Use Logical indexing (link) as illustrated...

약 21시간 ago | 0

Answered

Reading a csv file

You started off well w/ the readtable route...but, once you've got the table, then use the variables there, don't create new one...

Reading a csv file

You started off well w/ the readtable route...but, once you've got the table, then use the variables there, don't create new one...

1일 ago | 0

Answered

computing second derivative from txt/csv file based on existing excel algorithm

Here's perfect example why Matlab excels over Excel... :) txyz=importdata('B0264_dollyo_air_P_T01 rtoe.txt',',',8); % read the...

computing second derivative from txt/csv file based on existing excel algorithm

Here's perfect example why Matlab excels over Excel... :) txyz=importdata('B0264_dollyo_air_P_T01 rtoe.txt',',',8); % read the...

2일 ago | 0

| accepted

Answered

How can I save a word e.g. 'apple' in a text file, without matlab separating every letter with a comma?

You undoubtedly use csvwrite or similar to write a character array -- internally a char() array is just that--an array of number...

How can I save a word e.g. 'apple' in a text file, without matlab separating every letter with a comma?

You undoubtedly use csvwrite or similar to write a character array -- internally a char() array is just that--an array of number...

4일 ago | 1

| accepted

Answered

how to add a matrix element in a fzero function

As you wrote it, the function is the literal text including the argument so nothing ever gets substituted for dynamically--one w...

how to add a matrix element in a fzero function

As you wrote it, the function is the literal text including the argument so nothing ever gets substituted for dynamically--one w...

4일 ago | 0

| accepted

Answered

How to find intersection point of two curves, when the intersection point is not there in data sets?

Both intersection sections appear to be straight lines; fit them and use fzero to find the point bblue=polyfit(xblue,yblue,1); ...

How to find intersection point of two curves, when the intersection point is not there in data sets?

Both intersection sections appear to be straight lines; fit them and use fzero to find the point bblue=polyfit(xblue,yblue,1); ...

4일 ago | 0

| accepted

Answered

second degree polynomial regression and all the coefficients

Higher order polynomials aren't going to help here...the following code generated the figure: for i=3:9 subplot(4,2,i-2); ...

second degree polynomial regression and all the coefficients

Higher order polynomials aren't going to help here...the following code generated the figure: for i=3:9 subplot(4,2,i-2); ...

4일 ago | 0

| accepted

Answered

code for computing the pvalue

fnP=@(a,i) (sum(a(i)>a(1:i))+0.5*sum(a(i)==a(1:i)))/i; >> for i=2:numel(Si),fnP(Si,i),end ans = 0.75 ans = ...

code for computing the pvalue

fnP=@(a,i) (sum(a(i)>a(1:i))+0.5*sum(a(i)==a(1:i)))/i; >> for i=2:numel(Si),fnP(Si,i),end ans = 0.75 ans = ...

8일 ago | 1

| accepted

Answered

How to change values of x axis from numbers to dates

x = -10:0.1:10; y = sin(x); hF=figure; % keep handle to figure plot(x,y) hAx(1)=gca; ...

How to change values of x axis from numbers to dates

x = -10:0.1:10; y = sin(x); hF=figure; % keep handle to figure plot(x,y) hAx(1)=gca; ...

8일 ago | 1

| accepted

Answered

Correlating Two Arrays Using Correcoef

There's at least one NaN in the second variable...you don't give any information about which is which. >> spd=5*rand(500,1);tlt...

Correlating Two Arrays Using Correcoef

There's at least one NaN in the second variable...you don't give any information about which is which. >> spd=5*rand(500,1);tlt...

8일 ago | 0

| accepted

Answered

second degree polynomial regression and all the coefficients

Taking a shot that the presumption earlier is the correct one-- xy=xlsread('ML.xlsx','sheet2'); % read the data into array ...

second degree polynomial regression and all the coefficients

Taking a shot that the presumption earlier is the correct one-- xy=xlsread('ML.xlsx','sheet2'); % read the data into array ...

9일 ago | 0

Answered

Writing first and last line of each cell

Just have to handle the special case outside the loop... xx=zeros(length(xxMM)+1,6); xx(1,:)=xxMM{1,:}(1,:); for i=1:length(x...

Writing first and last line of each cell

Just have to handle the special case outside the loop... xx=zeros(length(xxMM)+1,6); xx(1,:)=xxMM{1,:}(1,:); for i=1:length(x...

11일 ago | 0

| accepted

Answered

Plotting graph of negative values of array in integral2 with 3 variables

The functional is invariant upon the the loop; remove the definition from inside the loop Use meaningful name for the degrees a...

Plotting graph of negative values of array in integral2 with 3 variables

The functional is invariant upon the the loop; remove the definition from inside the loop Use meaningful name for the degrees a...

11일 ago | 1

Answered

Finding pythagoras triples when only c is known

Somewhat more rudimentary would be UP=fix(sqrt(Csq-1)); % can't be bigger ignoring degenerate case of (sqrt(Csq^2),0) for i=1:...

Finding pythagoras triples when only c is known

Somewhat more rudimentary would be UP=fix(sqrt(Csq-1)); % can't be bigger ignoring degenerate case of (sqrt(Csq^2),0) for i=1:...

11일 ago | 1

Answered

Plot A Graph With Asymptotic Behavior

ymaxCX = max(max(CX), limCSss); yminCX = min(min(CX), limCSss); Just getting an overall min/max value of the data in vector C...

Plot A Graph With Asymptotic Behavior

ymaxCX = max(max(CX), limCSss); yminCX = min(min(CX), limCSss); Just getting an overall min/max value of the data in vector C...

12일 ago | 0

Answered

I need to classify my result in catagories

N=1.5*ones(size(ma)); N(abs(ma)==45 | abs(ma)==135)=-0.5; ... The rest should be self-evident from the above; lett as "exerci...

I need to classify my result in catagories

N=1.5*ones(size(ma)); N(abs(ma)==45 | abs(ma)==135)=-0.5; ... The rest should be self-evident from the above; lett as "exerci...

12일 ago | 0

Answered

Getting the correct y-intercept and gradient for a trend line using 'fit'

Looks quite right to me...the intercept is where the fitted line will cross (intercept) the y-axis at x=0...that point is way an...

Getting the correct y-intercept and gradient for a trend line using 'fit'

Looks quite right to me...the intercept is where the fitted line will cross (intercept) the y-axis at x=0...that point is way an...

12일 ago | 0

| accepted

Answered

How to add a column to an existing file?

Text sequential files are, well, "sequential" You can't just add in the middle by either column or line/record. data=importdat...

How to add a column to an existing file?

Text sequential files are, well, "sequential" You can't just add in the middle by either column or line/record. data=importdat...

13일 ago | 2

Answered

is it possible to copy a file on itself?

That isn't copying a file onto itself; there's nothing to prevent you doing what you want. Your copyfile command isn't referenc...

is it possible to copy a file on itself?

That isn't copying a file onto itself; there's nothing to prevent you doing what you want. Your copyfile command isn't referenc...

13일 ago | 0

Answered

Ploting every n-th result in a for loop

v=2;L=100; N=10; for t=0:0.01*N/v:L/v clf ... To introduce a 10-fold reduction...

Ploting every n-th result in a for loop

v=2;L=100; N=10; for t=0:0.01*N/v:L/v clf ... To introduce a 10-fold reduction...

13일 ago | 0

Answered

How can I plot hourly data in the same figure?

Use the features of Matlab to your advantage...granted, it takes some "time in grade!" to learn one's way around! :) As a gene...

How can I plot hourly data in the same figure?

Use the features of Matlab to your advantage...granted, it takes some "time in grade!" to learn one's way around! :) As a gene...

13일 ago | 0

| accepted

Answered

Create a table with Revenue by financial year such as 2017-18

t=readtable('chindamo.xlsx'); % read the input table data t.Code=categorical(t.Code); ...

Create a table with Revenue by financial year such as 2017-18

t=readtable('chindamo.xlsx'); % read the input table data t.Code=categorical(t.Code); ...

13일 ago | 0

| accepted

Answered

I can't delete plot and line in a figure

... p1 = line([xr xr],[0 f(xr)]); line([xr xr],[0 f(xr)]) ... x = [-10 0.01 10]; y = (x-xr).*df(xr)...

I can't delete plot and line in a figure

... p1 = line([xr xr],[0 f(xr)]); line([xr xr],[0 f(xr)]) ... x = [-10 0.01 10]; y = (x-xr).*df(xr)...

15일 ago | 0

| accepted

Answered

marker size difference between 'plot' and 'scatter' function

Per the documentation, scatter marker size property is marker proportional to area while the line marker property is proportiona...

marker size difference between 'plot' and 'scatter' function

Per the documentation, scatter marker size property is marker proportional to area while the line marker property is proportiona...

15일 ago | 0

| accepted

Answered

How to convert each row of the matrix into a Character array, without using a for command?

Preallocate B may help just tad... Alternatives to loop include B=cellstr(num2str(A)); but what is end purpose for doing the ...

How to convert each row of the matrix into a Character array, without using a for command?

Preallocate B may help just tad... Alternatives to loop include B=cellstr(num2str(A)); but what is end purpose for doing the ...

15일 ago | 0

| accepted

Answered

Black and Grey Bars in Barplot

Need to apply the colormap to something... hAx=subplot(2,2,1); clrs = [0 0 0; 0.9 0.9 0.9]; colormap(hAx,clrs); hB=bar([perc...

Black and Grey Bars in Barplot

Need to apply the colormap to something... hAx=subplot(2,2,1); clrs = [0 0 0; 0.9 0.9 0.9]; colormap(hAx,clrs); hB=bar([perc...

15일 ago | 0

| accepted

Question

Categorical variable in cell array?

This seems absurdly trivial but I haven't found the right syntax...I was trying to add a categorical variable to a cell array to...

16일 ago | 0 answers | 0

Answered

reading a very large number of csv files

Try https://www.mathworks.com/matlabcentral/fileexchange/10959-sort_nat-natural-order-sort and see if it will solve your probl...

reading a very large number of csv files

Try https://www.mathworks.com/matlabcentral/fileexchange/10959-sort_nat-natural-order-sort and see if it will solve your probl...

17일 ago | 1

Answered

rank keywords using length

[~,il]=sort(l,'descend'); K>> s(il) ans = 16×1 cell array {'third-greatest'} {'humanitarian' } {'Brussel...

rank keywords using length

[~,il]=sort(l,'descend'); K>> s(il) ans = 16×1 cell array {'third-greatest'} {'humanitarian' } {'Brussel...

19일 ago | 1

| accepted