1 600 total contributions since 2017

E-mails with feedback/questions about FEX submissions are welcomed. In general I will post e-mails about Answers on the related page, unless there is good cause not to do so.

Answered

Error using fprintf when copying cell content into a text file

The code below works, but it is probably better to define your FormatSpec in such a way that you can print your data line by lin...

Error using fprintf when copying cell content into a text file

The code below works, but it is probably better to define your FormatSpec in such a way that you can print your data line by lin...

3 jours ago | 1

| accepted

Answered

Divide the matrix randomly, based on columns

You mean like this? fractions=[70 15 15]; x=rand(78000,100);%use 100 to show the split is indeed 75:15:15 groups=cell(size(...

Divide the matrix randomly, based on columns

You mean like this? fractions=[70 15 15]; x=rand(78000,100);%use 100 to show the split is indeed 75:15:15 groups=cell(size(...

5 jours ago | 0

| accepted

Answered

Looping Factorial that adds successive terms

You should have just shown the last line. I first spent quite some time finding the correct method of implementing your non-desi...

Looping Factorial that adds successive terms

You should have just shown the last line. I first spent quite some time finding the correct method of implementing your non-desi...

6 jours ago | 0

Answered

Can someone give an easy explanation for what hObject is and what handles is in MATLAB GUI?

In GUIs that are generate by GUIDE, every callback has 3 arguments: hObject: the handle to the object that generated the callba...

Can someone give an easy explanation for what hObject is and what handles is in MATLAB GUI?

In GUIs that are generate by GUIDE, every callback has 3 arguments: hObject: the handle to the object that generated the callba...

6 jours ago | 1

| accepted

Answered

Lookup-scheme for potentially large n choose k matrices

If the citeria below are satisfied, you can use memoize: Performance is important. The function is time consuming. The functi...

Lookup-scheme for potentially large n choose k matrices

If the citeria below are satisfied, you can use memoize: Performance is important. The function is time consuming. The functi...

6 jours ago | 1

Answered

Name arrays based on a variable

The reasons why naming variables dynamically can be found here. It sounds like you are looking for the features a struct will pr...

Name arrays based on a variable

The reasons why naming variables dynamically can be found here. It sounds like you are looking for the features a struct will pr...

7 jours ago | 0

Answered

To make coding simplier and have the same plot

You could vectorize this, but using a loop is much easier and will probably have the same performance. Here is an example for t...

To make coding simplier and have the same plot

You could vectorize this, but using a loop is much easier and will probably have the same performance. Here is an example for t...

7 jours ago | 0

| accepted

Answered

Matching X and Y co-ordinated from the reference xy

Although you can solve this with the ismember function, you are actually looking for the intersect function: X = [1,2,3,4,5,6,7...

Matching X and Y co-ordinated from the reference xy

Although you can solve this with the ismember function, you are actually looking for the intersect function: X = [1,2,3,4,5,6,7...

7 jours ago | 1

| accepted

Answered

Passing array between GUI callbacks

This is in broad strokes how you can use getappdata and setappdata. h_fig=figure; %in your startup/constructor function: A=...

Passing array between GUI callbacks

This is in broad strokes how you can use getappdata and setappdata. h_fig=figure; %in your startup/constructor function: A=...

7 jours ago | 0

| accepted

Answered

I want t know if cell is contained in another cell?

The input to cellfun must be a cell, which will be unwrapped before handing it to the function. You als have curly brackets arou...

I want t know if cell is contained in another cell?

The input to cellfun must be a cell, which will be unwrapped before handing it to the function. You als have curly brackets arou...

8 jours ago | 0

Answered

how to switch the values of a variable

I guess boldly: This is probably your current code: figure(1),clf(1)%don't forget clf during debuggin array=[1 2 3 5 7]; x=l...

how to switch the values of a variable

I guess boldly: This is probably your current code: figure(1),clf(1)%don't forget clf during debuggin array=[1 2 3 5 7]; x=l...

11 jours ago | 0

Answered

What does the 'imfuse' output mean?

The output is an image. If you don't understand a function reading its documentation is an excellent start. Here is a link to th...

What does the 'imfuse' output mean?

The output is an image. If you don't understand a function reading its documentation is an excellent start. Here is a link to th...

11 jours ago | 1

Answered

So let's say I have a 3 row, 3 column matrix. If I code the following:

The documentation explains what the second input does. One of the advantages of Matlab over their competition is the documentati...

So let's say I have a 3 row, 3 column matrix. If I code the following:

The documentation explains what the second input does. One of the advantages of Matlab over their competition is the documentati...

11 jours ago | 0

Answered

How to plot a temperature in xy axis (2D temperature contour)?

The surf function expects a matrix, so you will have to convert your linear data to a matrix. The accumarray function is a very ...

How to plot a temperature in xy axis (2D temperature contour)?

The surf function expects a matrix, so you will have to convert your linear data to a matrix. The accumarray function is a very ...

12 jours ago | 0

| accepted

Answered

If I have an older version of Matlab can it be upgraded to a newer version like 2015 for free?

You can update to whichever release your license entitles you. This is different for different licenses. The download center sho...

If I have an older version of Matlab can it be upgraded to a newer version like 2015 for free?

You can update to whichever release your license entitles you. This is different for different licenses. The download center sho...

13 jours ago | 0

Answered

How to calculate mean of output in a for loop?

If you want to calculate the mean and the variance you will have to store the output. Since you know the number of iterations, y...

How to calculate mean of output in a for loop?

If you want to calculate the mean and the variance you will have to store the output. Since you know the number of iterations, y...

13 jours ago | 0

Answered

Is there anyway to convert GUI to .exe without using MATLAB Compiler ?

I am not aware of any method outside of Compiler that will allow you to do that. The only 'alternative' I know is using GNU Oct...

Is there anyway to convert GUI to .exe without using MATLAB Compiler ?

I am not aware of any method outside of Compiler that will allow you to do that. The only 'alternative' I know is using GNU Oct...

13 jours ago | 0

Answered

best option for storing metadata associated to each data file

Another way of thinking about metadata is that it is data itself. Store it as a separate plain text file with the exact same nam...

best option for storing metadata associated to each data file

Another way of thinking about metadata is that it is data itself. Store it as a separate plain text file with the exact same nam...

13 jours ago | 0

Answered

saving multiple .mat files with the same name from a script

Use sprintf to form the file names with a number. During the loading, you should load to an output variable and store all the...

saving multiple .mat files with the same name from a script

Use sprintf to form the file names with a number. During the loading, you should load to an output variable and store all the...

13 jours ago | 0

Answered

Few questions in matlab assignment

If you paste your code in the Matlab editor you will see two mlint warnings and one error. The first warning is that V is not d...

Few questions in matlab assignment

If you paste your code in the Matlab editor you will see two mlint warnings and one error. The first warning is that V is not d...

15 jours ago | 0

Answered

How to separate values of string input into other variables???

I'm puzzled why you would want this. The cause of your issue is that you aren't clear about your data types. The char array in f...

How to separate values of string input into other variables???

I'm puzzled why you would want this. The cause of your issue is that you aren't clear about your data types. The char array in f...

16 jours ago | 0

| accepted

Answered

Get Matlab R2019b as default program to open .m files on Windows 7

You can select the 'matlab.exe' file in the folder below: C:\Program Files\MATLAB\R2019b\bin\win64 That should make it show up...

Get Matlab R2019b as default program to open .m files on Windows 7

You can select the 'matlab.exe' file in the folder below: C:\Program Files\MATLAB\R2019b\bin\win64 That should make it show up...

17 jours ago | 0

| accepted

Answered

How can i calculate the center of mass ?

You can use the VOXELISE function to convert your mesh to a voxelgrid. Use a resolution that makes the most sense to you: too fe...

How can i calculate the center of mass ?

You can use the VOXELISE function to convert your mesh to a voxelgrid. Use a resolution that makes the most sense to you: too fe...

18 jours ago | 0

Answered

How to write low level text to a file without interpretation

If you want to write a char array, you should use the fprintf('%s', txt) syntax, otherwise fprintf will interpret your input as ...

How to write low level text to a file without interpretation

If you want to write a char array, you should use the fprintf('%s', txt) syntax, otherwise fprintf will interpret your input as ...

19 jours ago | 0

| accepted

Answered

How to write this equation?

There is a difference between log and log10. What you have done in Excel is actually calculate the log10, because you omitted th...

How to write this equation?

There is a difference between log and log10. What you have done in Excel is actually calculate the log10, because you omitted th...

20 jours ago | 2

| accepted

Answered

MATLAB Answers Wish-list #5 (and bug reports)

Another nice-to-have feature: being able to move threads between the answer section and comments without having to repost them. ...

MATLAB Answers Wish-list #5 (and bug reports)

Another nice-to-have feature: being able to move threads between the answer section and comments without having to repost them. ...

20 jours ago | 1

Answered

Creating a seperate high score file for Matlab game

There are several options to store data. If you need to store it in a file you can either use a mat file (with the save and load...

Creating a seperate high score file for Matlab game

There are several options to store data. If you need to store it in a file you can either use a mat file (with the save and load...

20 jours ago | 0

Answered

Managing maximum and minimum values in the elements of an matriz.

This should work. The idea is to first find out the base number, adjust the offset if needed, and add the base back. A = [2.1 ...

Managing maximum and minimum values in the elements of an matriz.

This should work. The idea is to first find out the base number, adjust the offset if needed, and add the base back. A = [2.1 ...

21 jours ago | 0

| accepted

Answered

Compatibility : get the Matlab minimum version required to run a program

The only reliable way I have found is to actually test it. An alternative is to carefully read the documentation of every functi...

Compatibility : get the Matlab minimum version required to run a program

The only reliable way I have found is to actually test it. An alternative is to carefully read the documentation of every functi...

21 jours ago | 0

| accepted

Answered

How to create a custom matrix?

This is a simple contatenation: n=8; %generate W and V W=randi(20,n,n); V=randi(5,n,3); output=[zeros(n,3) ; W*V];

How to create a custom matrix?

This is a simple contatenation: n=8; %generate W and V W=randi(20,n,n); V=randi(5,n,3); output=[zeros(n,3) ; W*V];

21 jours ago | 1

| accepted