Answered

How to read this kind of info out of a txt file and post them into Excel files?

Basically, just read the file record-by-record searching for the matching header strings and when find a section header, then re...

How to read this kind of info out of a txt file and post them into Excel files?

Basically, just read the file record-by-record searching for the matching header strings and when find a section header, then re...

1 day ago | 0

| accepted

Answered

How to average monthly data using a specific method in Matlab?

There may be a more clever way, but brute force seems straightforward enough... A=reshape(vectorA,3,[]); ...

How to average monthly data using a specific method in Matlab?

There may be a more clever way, but brute force seems straightforward enough... A=reshape(vectorA,3,[]); ...

2 days ago | 0

| accepted

Answered

How to retrieve multiple values from a 3D array

Ignoring the excessively verbose variable names that keeps code from being visible without scrolling or breaking line and thereb...

How to retrieve multiple values from a 3D array

Ignoring the excessively verbose variable names that keeps code from being visible without scrolling or breaking line and thereb...

2 days ago | 0

Answered

Computing the number of variables belonging to each data type

How about n_cl=countcats(categorical(varfun(@class,M,'OutputFormat','cell')))

Computing the number of variables belonging to each data type

How about n_cl=countcats(categorical(varfun(@class,M,'OutputFormat','cell')))

3 days ago | 0

| accepted

Answered

Can I plot a line function, and a plot function under an if statement?

"can put a line and plot function under an if statement. ...? It works when I try it ..." It would seem you've answered your ow...

Can I plot a line function, and a plot function under an if statement?

"can put a line and plot function under an if statement. ...? It works when I try it ..." It would seem you've answered your ow...

4 days ago | 0

| accepted

Answered

Reading Specific numbers from a text file

fileID = fopen(filename); Cdata = textscan(fileID,'%f32 %f32 %f32','HeaderLines',5); % find the point coordi...

Reading Specific numbers from a text file

fileID = fopen(filename); Cdata = textscan(fileID,'%f32 %f32 %f32','HeaderLines',5); % find the point coordi...

4 days ago | 0

| accepted

Answered

How to protect arbitrary variable names

Functions have their own workspace although internal and anonymous functions share their context with the containing workspace.....

How to protect arbitrary variable names

Functions have their own workspace although internal and anonymous functions share their context with the containing workspace.....

4 days ago | 0

| accepted

Answered

displaying element of matrix

To use disp and have two decimal points, use format bank first, otherwise will get whatever precision is associated with the cur...

displaying element of matrix

To use disp and have two decimal points, use format bank first, otherwise will get whatever precision is associated with the cur...

6 days ago | 0

Answered

How to plot 3 graphs in 1 figure?

There's an example of 2 on top and one on bottom that should have given the clue of how to bo about it... hAx(1)=subplot(2,2,1)...

How to plot 3 graphs in 1 figure?

There's an example of 2 on top and one on bottom that should have given the clue of how to bo about it... hAx(1)=subplot(2,2,1)...

7 days ago | 1

| accepted

Answered

Need to run two counters in a foor loop

If you describe the real problem to be solved instead, it'll lead to more efficient getting to the right answer, but if the resu...

Need to run two counters in a foor loop

If you describe the real problem to be solved instead, it'll lead to more efficient getting to the right answer, but if the resu...

7 days ago | 0

Answered

How can I find peak from matrix

What's wrong with what you've done for the one? findpeaks is one of the functions that has not been vectorized (owing to its co...

How can I find peak from matrix

What's wrong with what you've done for the one? findpeaks is one of the functions that has not been vectorized (owing to its co...

7 days ago | 0

Answered

Write a tabbed matrix in a txt file

Read the rest of the documentation for dlmwrite -- Name-Value Pair Arguments ... 'precision' — Numeric precision ...

Write a tabbed matrix in a txt file

Read the rest of the documentation for dlmwrite -- Name-Value Pair Arguments ... 'precision' — Numeric precision ...

8 days ago | 0

| accepted

Answered

Full Factorial Design of Experiments

"I know about the matlab function fullfact([,]) but since I will use decimal numbers i needed a differen solution." There's no ...

Full Factorial Design of Experiments

"I know about the matlab function fullfact([,]) but since I will use decimal numbers i needed a differen solution." There's no ...

8 days ago | 1

| accepted

Answered

for loop to subtract every element from the first element for a given trial

Another job for varfun and grouping variables-- tt.TrialTime=cell2mat(rowfun(@(m)m-m(1),tt,'GroupingVariables','TrialNumber', ....

for loop to subtract every element from the first element for a given trial

Another job for varfun and grouping variables-- tt.TrialTime=cell2mat(rowfun(@(m)m-m(1),tt,'GroupingVariables','TrialNumber', ....

9 days ago | 0

| accepted

Answered

How do I make two arrays go from largest to smallest?

[a,ix] = sort([4 8 11 7],'descend'); % keep the optional original order vector when sort b = b(ix); ...

How do I make two arrays go from largest to smallest?

[a,ix] = sort([4 8 11 7],'descend'); % keep the optional original order vector when sort b = b(ix); ...

10 days ago | 1

| accepted

Answered

how to plot cell array and how to get its imaginary part?

Use cell indexing expressions-- >> c={[rand(4,1),rand(4,1)]}; % presume the format described for some sample data >> c{:} ...

how to plot cell array and how to get its imaginary part?

Use cell indexing expressions-- >> c={[rand(4,1),rand(4,1)]}; % presume the format described for some sample data >> c{:} ...

14 days ago | 0

| accepted

Answered

Understanding the structfun() or cellfun() commands

As the error message and doc says, structfun applies a function to each field in a scalar struct; you have a struct array -- not...

Understanding the structfun() or cellfun() commands

As the error message and doc says, structfun applies a function to each field in a scalar struct; you have a struct array -- not...

15 days ago | 0

Answered

How can I find mean crossing irregularity?

z=randn(1,1000); % sample dataset zs=(detrend(z)>0); % convert to binary at mean iz=diff(find([0 zs])); % crossin...

How can I find mean crossing irregularity?

z=randn(1,1000); % sample dataset zs=(detrend(z)>0); % convert to binary at mean iz=diff(find([0 zs])); % crossin...

20 days ago | 0

Answered

Assign same linewidth to a grouped barplot

You can't use the "dot" notation with an array of handles, anyway; must use set here, or a looping construct of some sort. se...

Assign same linewidth to a grouped barplot

You can't use the "dot" notation with an array of handles, anyway; must use set here, or a looping construct of some sort. se...

24 days ago | 1

Answered

How to compare two columns in a table and delete that row having same values in that columns?

c=string({'column1' 'column 2' 'columns3' 'ball' 'bat' 'gloves' 'bat' 'gloves' 'bat' 'ball' ...

How to compare two columns in a table and delete that row having same values in that columns?

c=string({'column1' 'column 2' 'columns3' 'ball' 'bat' 'gloves' 'bat' 'gloves' 'bat' 'ball' ...

26 days ago | 0

Answered

Error using corrplot function

OK, I played with one of the sample datasets used for illustrating some other regression stuff...it is possible to start with pl...

Error using corrplot function

OK, I played with one of the sample datasets used for illustrating some other regression stuff...it is possible to start with pl...

26 days ago | 0

Answered

Binomial Distribution when mean and variance is given

Well, sometimes one is given a nonsensical problem -- if so, then one has to inform the requestor of the fact and get a differen...

Binomial Distribution when mean and variance is given

Well, sometimes one is given a nonsensical problem -- if so, then one has to inform the requestor of the fact and get a differen...

27 days ago | 0

| accepted

Answered

2 digits after the dot

In the first case, you'll have to use >> string(arrayfun(@(n)sprintf('%.2f',n),vals,'UniformOutput',false)) ans = 2×3 str...

2 digits after the dot

In the first case, you'll have to use >> string(arrayfun(@(n)sprintf('%.2f',n),vals,'UniformOutput',false)) ans = 2×3 str...

27 days ago | 0

| accepted

Answered

Generating a heat map of adjacency matrix

Presuming you want the displayed values of the cells to still be their totals, then s = [1 1 1 2 2 3]; t = [2 3 4 5 6 7]; G =...

Generating a heat map of adjacency matrix

Presuming you want the displayed values of the cells to still be their totals, then s = [1 1 1 2 2 3]; t = [2 3 4 5 6 7]; G =...

27 days ago | 0

| accepted

Answered

Check for missing argument or incorrect argument data type in call to function 'predict'.

I've never used fitrlinear (didn't know it existed, in fact), but it appears that it returns a composite object and that the req...

Check for missing argument or incorrect argument data type in call to function 'predict'.

I've never used fitrlinear (didn't know it existed, in fact), but it appears that it returns a composite object and that the req...

27 days ago | 1

| accepted

Answered

How to change values to 3 decimal points and 7 significant figures?

You can't set an arbitrary format string or precision for command window output; only the few selectable choices given by the fo...

How to change values to 3 decimal points and 7 significant figures?

You can't set an arbitrary format string or precision for command window output; only the few selectable choices given by the fo...

27 days ago | 3

| accepted

Answered

Search for minimal value in column of table when value in other columns are the same

function [f,ix]=fastest(d,r) % return minimum of input time of travel array, d and % corresponding row index of minimum from ...

Search for minimal value in column of table when value in other columns are the same

function [f,ix]=fastest(d,r) % return minimum of input time of travel array, d and % corresponding row index of minimum from ...

27 days ago | 0

| accepted

Answered

histogram style graph with several different data types with each type coloured differently

Actually, it's not too bad to just make up something...not sure where and why you ran into difficulties without seeing what sort...

histogram style graph with several different data types with each type coloured differently

Actually, it's not too bad to just make up something...not sure where and why you ran into difficulties without seeing what sort...

28 days ago | 0

| accepted

Answered

how to read a data from text file

zein=readlines('yourfilename.txt'); xyz=str2double(split(extractBetween(zein(3:end-1),'(',')')," "));

how to read a data from text file

zein=readlines('yourfilename.txt'); xyz=str2double(split(extractBetween(zein(3:end-1),'(',')')," "));

28 days ago | 0

| accepted

Answered

How can I order a matrix in a specific order?

I've no klew what amplapi is, but if you have a text file like the first, reading it into MATLAB will not reorder it. >> which ...

How can I order a matrix in a specific order?

I've no klew what amplapi is, but if you have a text file like the first, reading it into MATLAB will not reorder it. >> which ...

29 days ago | 0

| accepted