Answered

Function with 2 variables

See <https://se.mathworks.com/help/matlab/ref/log.html log, Natural logarithm> and try >> ZP=[-41 -45 -53]; SA=[0.001 0....

Function with 2 variables

See <https://se.mathworks.com/help/matlab/ref/log.html log, Natural logarithm> and try >> ZP=[-41 -45 -53]; SA=[0.001 0....

3 days ago | 0

Answered

An error (Two different outputs for a single command)

*|k_|* is a row vector, which explains why *|gamma|* becomes a row vector >> whos k_ gamma Name Size ...

An error (Two different outputs for a single command)

*|k_|* is a row vector, which explains why *|gamma|* becomes a row vector >> whos k_ gamma Name Size ...

14 days ago | 0

| accepted

Answered

how do i get the last points of every 100 points from a 1000 point graph

_"how do i get the last points of every [sequence of] 100 points from a [sequence of] 1000 point[s]"_ That's my interpreta...

how do i get the last points of every 100 points from a 1000 point graph

_"how do i get the last points of every [sequence of] 100 points from a [sequence of] 1000 point[s]"_ That's my interpreta...

16 days ago | 0

| accepted

Answered

MatLab isn't reading the entirety of my data?

AFAIK: *|dir|* is the only function that takes wildcards in folder names. *Doc on |dir| says:* [...] To search through fo...

MatLab isn't reading the entirety of my data?

AFAIK: *|dir|* is the only function that takes wildcards in folder names. *Doc on |dir| says:* [...] To search through fo...

25 days ago | 0

| accepted

Answered

Singleton error causing mismatch?

Try replacing report(i,1)=props(i).name; by report(i,1)={props(i).name}; and see <https://se.mathworks.com/help...

Singleton error causing mismatch?

Try replacing report(i,1)=props(i).name; by report(i,1)={props(i).name}; and see <https://se.mathworks.com/help...

28 days ago | 0

Answered

MYSTERY matlab Error - Index exceeds matrix dimensions - can't track it!

* *B is overwritten* at line 43 and the following loop. * In the second and the following iterations of the outer loop, *|t>...

MYSTERY matlab Error - Index exceeds matrix dimensions - can't track it!

* *B is overwritten* at line 43 and the following loop. * In the second and the following iterations of the outer loop, *|t>...

1 month ago | 0

Answered

Creating a class object with the same class name as a variable

You could create a function, *|factory|*, to communicate the intent. K = 'a1'; obj = factory( K ); where functio...

Creating a class object with the same class name as a variable

You could create a function, *|factory|*, to communicate the intent. K = 'a1'; obj = factory( K ); where functio...

1 month ago | 0

Answered

Need help. I have extract a specific column from file and it contains zeros. How to remove those zero so it can match the vector and can be plotted??

Try Col(Col==0)=[];

Need help. I have extract a specific column from file and it contains zeros. How to remove those zero so it can match the vector and can be plotted??

Try Col(Col==0)=[];

1 month ago | 0

| accepted

Answered

Extracting parts of a string

Is this what you are looking for? %% fid = fopen( '00000090Head.txt', 'r' ); cac = textscan( fid, '%*s%f%*f%*f%*f%...

Extracting parts of a string

Is this what you are looking for? %% fid = fopen( '00000090Head.txt', 'r' ); cac = textscan( fid, '%*s%f%*f%*f%*f%...

1 month ago | 1

Answered

Matrix indexing and plotting related doubt.

It seems as if you need to use *|squeeze|* to get a 2D matrix %% mat = zeros( 20, 50, 187 ); len = numel( mat ); m...

Matrix indexing and plotting related doubt.

It seems as if you need to use *|squeeze|* to get a 2D matrix %% mat = zeros( 20, 50, 187 ); len = numel( mat ); m...

1 month ago | 0

Answered

Generate a Definite timestamp sequence

The old way >> vec = repmat([2018,3,1,0,0,0], 31*24*12, 1 ); >> minutes = ( 0 : 5 : 5*(31*24*12-1) )'; >> vec(:,5) = ...

Generate a Definite timestamp sequence

The old way >> vec = repmat([2018,3,1,0,0,0], 31*24*12, 1 ); >> minutes = ( 0 : 5 : 5*(31*24*12-1) )'; >> vec(:,5) = ...

1 month ago | 0

Answered

Plot: dealing with data available only on weekdays

I assume * *|X|* and *|Y|* have the same length * *|Z|* is shorter than *|X|* * *|Y|* and *|Z|* hold one value per day * ...

Plot: dealing with data available only on weekdays

I assume * *|X|* and *|Y|* have the same length * *|Z|* is shorter than *|X|* * *|Y|* and *|Z|* hold one value per day * ...

1 month ago | 0

Answered

Sum of base exponentials e

Matlab is clever >> 5*sum( exp(x1), 2 ) ans = 1.0e+04 * 5.545715485358022 0.017431824560524

Sum of base exponentials e

Matlab is clever >> 5*sum( exp(x1), 2 ) ans = 1.0e+04 * 5.545715485358022 0.017431824560524

2 months ago | 0

| accepted

Answered

How to move files based one whether their name is contained in a spreadsheet?

>> cssm moves the files <</matlabcentral/answers/uploaded_files/119096/snip_20180526101155.png>> where ...

How to move files based one whether their name is contained in a spreadsheet?

>> cssm moves the files <</matlabcentral/answers/uploaded_files/119096/snip_20180526101155.png>> where ...

2 months ago | 1

| accepted

Answered

Arrow between two subplots

See <https://se.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.line-properties.html Line Properties>. Set the val...

Arrow between two subplots

See <https://se.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.line-properties.html Line Properties>. Set the val...

2 months ago | 0

Answered

Attempt to execute SCRIPT builtin as a function:

*PLS_Toolbox_852* is the name of a toolbox by <http://www.eigenvector.com/software/pls_toolbox.htm Eigenvector Research, Inc>. K...

Attempt to execute SCRIPT builtin as a function:

*PLS_Toolbox_852* is the name of a toolbox by <http://www.eigenvector.com/software/pls_toolbox.htm Eigenvector Research, Inc>. K...

2 months ago | 0

Answered

Can someone tell me why I keep getting parse and syntax errors here?

To make your code more readable, I formatted it and in that process added a closing *|end|*. Now, your code works just fine ...

Can someone tell me why I keep getting parse and syntax errors here?

To make your code more readable, I formatted it and in that process added a closing *|end|*. Now, your code works just fine ...

2 months ago | 0

Answered

What does this Error code mean ?

Deep in the code of Matlab itself Handle input argument contains non handle values a nonhandle value was passed where ...

What does this Error code mean ?

Deep in the code of Matlab itself Handle input argument contains non handle values a nonhandle value was passed where ...

2 months ago | 0

Answered

Help using Regexp:

One way >> str='Some.Text {a1=v1 a2=v2}'; >> cac = regexp( str, '(?<={)[^}]+(?=})', 'once', 'match' ) cac = a1=v1 ...

Help using Regexp:

One way >> str='Some.Text {a1=v1 a2=v2}'; >> cac = regexp( str, '(?<={)[^}]+(?=})', 'once', 'match' ) cac = a1=v1 ...

2 months ago | 0

| accepted

Answered

Creating a vector with nested for loops and a while loop

One way >> cssm ans = 2 4 8 16 32 64 128 256 >> where function vector = cssm ...

Creating a vector with nested for loops and a while loop

One way >> cssm ans = 2 4 8 16 32 64 128 256 >> where function vector = cssm ...

2 months ago | 1

| accepted

Answered

MATLAB writing text file “invalid permission” in UBUNTU

Doc says: <https://se.mathworks.com/help/matlab/ref/fopen.html?searchHighlight=fopen&s_tid=doc_srchtitle fileID = fopen(filename...

MATLAB writing text file “invalid permission” in UBUNTU

Doc says: <https://se.mathworks.com/help/matlab/ref/fopen.html?searchHighlight=fopen&s_tid=doc_srchtitle fileID = fopen(filename...

2 months ago | 0

| accepted

Answered

Transferring 4 already plotted figures into one with subplots

AFAIK: Matlab doesn't provide a specific tool to copy the content of separate figures to subplots of one figure. However, there ...

Transferring 4 already plotted figures into one with subplots

AFAIK: Matlab doesn't provide a specific tool to copy the content of separate figures to subplots of one figure. However, there ...

2 months ago | 0

Answered

How can I remove a duplicate set values?

I guess * *|d|* is a row vector of whole numbers * *|d|* consists of multiple sets of *three* numbers * you s...

How can I remove a duplicate set values?

I guess * *|d|* is a row vector of whole numbers * *|d|* consists of multiple sets of *three* numbers * you s...

2 months ago | 1

Answered

Using dlmwrite to save data?

_"Too many output arguments."_ Remove the output, i.e. replace spillData = dlmwrite('spillData.txt',spillLength,'de...

Using dlmwrite to save data?

_"Too many output arguments."_ Remove the output, i.e. replace spillData = dlmwrite('spillData.txt',spillLength,'de...

2 months ago | 1

| accepted

Answered

Calculating the sum of the absolute differences of a matrix

Here is a script that builds on my answer to your last question %% x = [0 0 1 2 4 2 5 1 0 0 3 7 9 6 9 0 0 0 0 3 7 0 ...

Calculating the sum of the absolute differences of a matrix

Here is a script that builds on my answer to your last question %% x = [0 0 1 2 4 2 5 1 0 0 3 7 9 6 9 0 0 0 0 3 7 0 ...

2 months ago | 0

Answered

How do I sum the first 3 values after each zero

This %% x = [0 0 1 2 4 2 5 1 0 0 3 7 9 6 9 0 0 0 0 3 7 0 0 0 2]; dx = [ 0, diff( x ) ]; len = length( x ); ...

How do I sum the first 3 values after each zero

This %% x = [0 0 1 2 4 2 5 1 0 0 3 7 9 6 9 0 0 0 0 3 7 0 0 0 2]; dx = [ 0, diff( x ) ]; len = length( x ); ...

2 months ago | 1

| accepted

Answered

How can I get plain text diary files?

Until something better turns up try %% ffs = 'c:\tmp\dbch_diary.txt'; str = fileread( ffs ); %% out = regexpr...

How can I get plain text diary files?

Until something better turns up try %% ffs = 'c:\tmp\dbch_diary.txt'; str = fileread( ffs ); %% out = regexpr...

3 months ago | 0

Answered

How can I make my code faster?

Firstly, run *|profile|* on your code to find the bottlenecks. See <https://se.mathworks.com/help/matlab/ref/profile.html profil...

How can I make my code faster?

Firstly, run *|profile|* on your code to find the bottlenecks. See <https://se.mathworks.com/help/matlab/ref/profile.html profil...

3 months ago | 0

Answered

Removing Excess Data From a .csv File using Textscan

As Walter Roberson noted, the file *|Example.csv|*, which you attached, is an Excel-file. *|textscan|* cannot read Excel-...

Removing Excess Data From a .csv File using Textscan

As Walter Roberson noted, the file *|Example.csv|*, which you attached, is an Excel-file. *|textscan|* cannot read Excel-...

3 months ago | 1

Answered

How can I reduce the computation time for this MATLAB code? It always shows busy without giving any output

I put your code in a function and profiled it. See <https://se.mathworks.com/help/matlab/ref/profile.html profile, Profile execu...

How can I reduce the computation time for this MATLAB code? It always shows busy without giving any output

I put your code in a function and profiled it. See <https://se.mathworks.com/help/matlab/ref/profile.html profile, Profile execu...

3 months ago | 1