Answered

Finding maximum value and corresponding variable

P = rand(10,40,10); % Some pretend data [P_max,linear_index_max] = max(P(:)); % Find max and index, for linearized matrix [mc,...

Finding maximum value and corresponding variable

P = rand(10,40,10); % Some pretend data [P_max,linear_index_max] = max(P(:)); % Find max and index, for linearized matrix [mc,...

18 hours ago | 0

| accepted

Answered

Plot and interp using Spline method

It's presumably because you have not chosen your query points to be very close together. Do you get something closer to what you...

Plot and interp using Spline method

It's presumably because you have not chosen your query points to be very close together. Do you get something closer to what you...

7 days ago | 0

Answered

how can i get activation key

If you are looking to purchase MATLAB products, you could start at the MATLAB store.

how can i get activation key

If you are looking to purchase MATLAB products, you could start at the MATLAB store.

8 days ago | 0

Answered

How can I add an expiration date and time to my script or P-code file?

One way that you could do it would be to put a line in your *.m file code that checks the date [using, for example, the now() fu...

How can I add an expiration date and time to my script or P-code file?

One way that you could do it would be to put a line in your *.m file code that checks the date [using, for example, the now() fu...

10 days ago | 0

Answered

list names in an array

I'm pretty sure there is a better, simpler way to do this, but I believe this does what you want: s = dir; fileList = cellfun(...

list names in an array

I'm pretty sure there is a better, simpler way to do this, but I believe this does what you want: s = dir; fileList = cellfun(...

11 days ago | 1

Answered

I need some help with arrayfun

I believe that groupsummary is for data stored in tables only. You can do what you want with [sortedResponses,~,idx] = unique(...

I need some help with arrayfun

I believe that groupsummary is for data stored in tables only. You can do what you want with [sortedResponses,~,idx] = unique(...

12 days ago | 0

Answered

How to do feature selection by maximizing Rsquared for linear regression model ?

I believe you just need to redefine the critfun function from the one in the example: function dev = critfun(X,Y) model = fitg...

How to do feature selection by maximizing Rsquared for linear regression model ?

I believe you just need to redefine the critfun function from the one in the example: function dev = critfun(X,Y) model = fitg...

14 days ago | 0

Answered

How do I optionally disable code for a missing toolbox?

All credit to Walter, but I believe you'll want to do this test: license('test','Distrib_Computing_Toolbox')

How do I optionally disable code for a missing toolbox?

All credit to Walter, but I believe you'll want to do this test: license('test','Distrib_Computing_Toolbox')

14 days ago | 0

Answered

Why the script of function is always stored in two files ".m" and ".m~"?

It is an auto-saved backup file. See this page for details.

Why the script of function is always stored in two files ".m" and ".m~"?

It is an auto-saved backup file. See this page for details.

22 days ago | 2

| accepted

Answered

How to plot???

I suggest you take a look at the MATLAB Plot Gallery to find something similar, and use that as a starting point. It looks like ...

How to plot???

I suggest you take a look at the MATLAB Plot Gallery to find something similar, and use that as a starting point. It looks like ...

24 days ago | 0

Answered

how to calculate integral pdf ?

The probability is the integral of the PDF over a range. You can approximate that integral as a sum: pdf = @(x) 2*x; x1 = 0;...

how to calculate integral pdf ?

The probability is the integral of the PDF over a range. You can approximate that integral as a sum: pdf = @(x) 2*x; x1 = 0;...

25 days ago | 0

| accepted

Answered

Error: Cannot set support to 'positive' with non-positive data.

You've checked that your data are non-negative, not they're positive. I'm guessing that you have zeros, and the positive-support...

Error: Cannot set support to 'positive' with non-positive data.

You've checked that your data are non-negative, not they're positive. I'm guessing that you have zeros, and the positive-support...

25 days ago | 1

| accepted

Answered

Do I need to reference matlab in an academic paper?

The most common thing I have seen is to state the software and version used (e.g. MATLAB ver. R2018b), within the Methods sectio...

Do I need to reference matlab in an academic paper?

The most common thing I have seen is to state the software and version used (e.g. MATLAB ver. R2018b), within the Methods sectio...

28 days ago | 0

Answered

Excluding date from date and time

You should be able to use the timeofday function. The resulting output will be a duration array.

Excluding date from date and time

You should be able to use the timeofday function. The resulting output will be a duration array.

29 days ago | 0

Answered

Error in Mosaicing (line 44) new_img(i,k) = N(i,k-Index+1);%%to stich the 2nd image after index. Index exceeds matrix dimensions. what does this mean?

It means that when MATLAB tries to do the operation new_img(i,k) = N(i,k-Index+1); that either new_img is a smaller array tha...

Error in Mosaicing (line 44) new_img(i,k) = N(i,k-Index+1);%%to stich the 2nd image after index. Index exceeds matrix dimensions. what does this mean?

It means that when MATLAB tries to do the operation new_img(i,k) = N(i,k-Index+1); that either new_img is a smaller array tha...

29 days ago | 0

Answered

the command after "if" not work after awhile

My best guess here is that you are running up against the limitations of floating point computation. For example, try putting th...

the command after "if" not work after awhile

My best guess here is that you are running up against the limitations of floating point computation. For example, try putting th...

1 month ago | 2

| accepted

Answered

How do I get a bar chart in the newest version but with the colors from an older version?

There are utilities (e.g. "Digital Color Meter" on a Mac) where you can hover your cursor over a pixel on the screen, and it wil...

How do I get a bar chart in the newest version but with the colors from an older version?

There are utilities (e.g. "Digital Color Meter" on a Mac) where you can hover your cursor over a pixel on the screen, and it wil...

1 month ago | 0

Answered

How a matlab function or toolbox works?

A cursory look at the software engineering career postings on the Mathworks site suggests that current development is in C, C++,...

How a matlab function or toolbox works?

A cursory look at the software engineering career postings on the Mathworks site suggests that current development is in C, C++,...

1 month ago | 2

Answered

Random Test Dataset With More Values Of One Type

One simple approach would be: split your dataset into the y=0 set and the y = 1 set do the 80/20 training/test split on the y=...

Random Test Dataset With More Values Of One Type

One simple approach would be: split your dataset into the y=0 set and the y = 1 set do the 80/20 training/test split on the y=...

1 month ago | 1

Answered

is there any way to use both Spearman and Euclidean distance using knnsearch ?

No, they cannot both be used within a single call to knnsearch. I don't really see how "merging" would really be that helpful. ...

is there any way to use both Spearman and Euclidean distance using knnsearch ?

No, they cannot both be used within a single call to knnsearch. I don't really see how "merging" would really be that helpful. ...

1 month ago | 1

| accepted

Answered

How can I separate complex numbers from the other in a matrix?

% Example data z = [1 1+2*i 3 4+5*i] mask = imag(z)==0; The variable mask is a logical variable that is TRUE at the locatio...

How can I separate complex numbers from the other in a matrix?

% Example data z = [1 1+2*i 3 4+5*i] mask = imag(z)==0; The variable mask is a logical variable that is TRUE at the locatio...

2 months ago | 2

| accepted

Answered

Finding the locations of non-similar value cells

I'm not certain I understand exactly what you want, but this is my best guess: % Define input arrays CA = {[-10 2],[6;6]}; CB...

Finding the locations of non-similar value cells

I'm not certain I understand exactly what you want, but this is my best guess: % Define input arrays CA = {[-10 2],[6;6]}; CB...

2 months ago | 0

Answered

NIST Randomness test execution

The answer from Peter Perkins here is old, but I believe it is still accurate.

NIST Randomness test execution

The answer from Peter Perkins here is old, but I believe it is still accurate.

2 months ago | 0

| accepted

Answered

For every matrix row find rows within the same matrix that have more than one common element in same index below the row

Here is a start at a solution for you. A = [ 1 2 3 1 4 5 3 4 5 1 2 4 1 2 5 2 4 5]; for i = 1:size(A,1)-1 r{i} = f...

For every matrix row find rows within the same matrix that have more than one common element in same index below the row

Here is a start at a solution for you. A = [ 1 2 3 1 4 5 3 4 5 1 2 4 1 2 5 2 4 5]; for i = 1:size(A,1)-1 r{i} = f...

2 months ago | 0

| accepted

Answered

Serious mistake installing Matlab

Does this documentation page about uninstalling MATLAB help?

Serious mistake installing Matlab

Does this documentation page about uninstalling MATLAB help?

2 months ago | 0

Answered

How to write cell arrays in Excel?

I use cellwrite from the File Exchange.

How to write cell arrays in Excel?

I use cellwrite from the File Exchange.

2 months ago | 0

Answered

I would like to call a row element from a matrix however, the row is written inside another matrix

If T is the temperature matrix, then it sounds like maybe you want to do T(A(1)) Or use a loop to access more rows of T? for ...

I would like to call a row element from a matrix however, the row is written inside another matrix

If T is the temperature matrix, then it sounds like maybe you want to do T(A(1)) Or use a loop to access more rows of T? for ...

2 months ago | 1

Answered

ismember 0×0 empty logical array to logic

Making a huge guess here, but are you sure you don't mean ~ismember(ID,A) rather than ~ismember(A,ID) Then, assuming ID is a...

ismember 0×0 empty logical array to logic

Making a huge guess here, but are you sure you don't mean ~ismember(ID,A) rather than ~ismember(A,ID) Then, assuming ID is a...

2 months ago | 0

Answered

I have a csv file, which contains some 0 and some non-zero values. How to get the index of the non-zero values in the csv file?

data = csvread('Book4.csv'); idx = find(data);

I have a csv file, which contains some 0 and some non-zero values. How to get the index of the non-zero values in the csv file?

data = csvread('Book4.csv'); idx = find(data);

2 months ago | 1

| accepted