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.

답변 있음

how to get an matrix as an output in a function

The mlint is giving you a hint: it wants you to put a semicolon to suppres output. Why would you have an output with the for loo...

how to get an matrix as an output in a function

The mlint is giving you a hint: it wants you to put a semicolon to suppres output. Why would you have an output with the for loo...

약 16시간 전 | 1

답변 있음

Dividing x tick labels

The XTick property contains a vector with all the positions that should have a tick. The XTickLabel property contains the values...

Dividing x tick labels

The XTick property contains a vector with all the positions that should have a tick. The XTickLabel property contains the values...

약 18시간 전 | 0

답변 있음

class vs data type?

In general I would consider 'class' a superset of 'data type' and only include the core Matlab clases a list of data types, so t...

class vs data type?

In general I would consider 'class' a superset of 'data type' and only include the core Matlab clases a list of data types, so t...

약 19시간 전 | 0

답변 있음

Defining scatter plot with different 'markers' & 'colors'

This should be close to what you need: test = xlsread('HQ3.xlsx', 'A2:D223'); x=test(:,1); y=test(:,2); z=test(:,3); groups...

Defining scatter plot with different 'markers' & 'colors'

This should be close to what you need: test = xlsread('HQ3.xlsx', 'A2:D223'); x=test(:,1); y=test(:,2); z=test(:,3); groups...

약 19시간 전 | 0

답변 있음

Creating submatrix with variable indexing

The code below isn't elegant, but it should do what you want. The example is for just 2x2xN. Despite the name, the slow method i...

Creating submatrix with variable indexing

The code below isn't elegant, but it should do what you want. The example is for just 2x2xN. Despite the name, the slow method i...

2일 전 | 0

답변 있음

Why won't matlab plot data from a table?

You're trying to plot a scalar multiple times, which Matlab happily does for you. You won't see anything, because your line styl...

Why won't matlab plot data from a table?

You're trying to plot a scalar multiple times, which Matlab happily does for you. You won't see anything, because your line styl...

3일 전 | 0

| 수락됨

답변 있음

Why is this so slow?

Loops with many elements are slow. You also forgot to properly pre-allocate s. N = 10^5; a = 0; b = 4; r = a + (b-a)*rand(N,...

Why is this so slow?

Loops with many elements are slow. You also forgot to properly pre-allocate s. N = 10^5; a = 0; b = 4; r = a + (b-a)*rand(N,...

3일 전 | 2

답변 있음

买了可以用多久

In general you can use the student version for as long as you are a student. Note that officially you can only use the student v...

买了可以用多久

In general you can use the student version for as long as you are a student. Note that officially you can only use the student v...

4일 전 | 0

답변 있음

campare a row value with the next row

You were close when using diff. You need to think what characterizes all four combinations. The code below should be what you ne...

campare a row value with the next row

You were close when using diff. You need to think what characterizes all four combinations. The code below should be what you ne...

4일 전 | 1

| 수락됨

답변 있음

Pass variables from callbacks to custom functions in a GUI

I'm going to assume the error occurs at this line guidata(app, handles); You are mixing a GUIDE-style GUI syntax with an AppDe...

Pass variables from callbacks to custom functions in a GUI

I'm going to assume the error occurs at this line guidata(app, handles); You are mixing a GUIDE-style GUI syntax with an AppDe...

4일 전 | 0

답변 있음

How to Turn Imagesc to x and y?

You can generate the coordinates with ndgrid and then you can linearize the three matrices and use them as input to plot3. ...

How to Turn Imagesc to x and y?

You can generate the coordinates with ndgrid and then you can linearize the three matrices and use them as input to plot3. ...

4일 전 | 1

답변 있음

How do I sum the outputs of a for loop?

Create a variable before the loop and set it to 0. Inside the loop you can add the value of Winnings to this variable.

How do I sum the outputs of a for loop?

Create a variable before the loop and set it to 0. Inside the loop you can add the value of Winnings to this variable.

6일 전 | 0

| 수락됨

답변 있음

creating new matrix from remaining of existing 2 matrices

Use ismember with the rows switch to find the rows in A that exist in B, flip this logical vector with ~ and use the result to i...

creating new matrix from remaining of existing 2 matrices

Use ismember with the rows switch to find the rows in A that exist in B, flip this logical vector with ~ and use the result to i...

6일 전 | 0

| 수락됨

답변 있음

Error due to matrix dimensions not being consistent

You have shadowed the internal function mtimes which is used when you use the * operator. Renaming your function should solve th...

Error due to matrix dimensions not being consistent

You have shadowed the internal function mtimes which is used when you use the * operator. Renaming your function should solve th...

7일 전 | 0

답변 있음

how to assign certain range of pixel values with desired color for classification of image?

What you need to do is replicate your grayscale image to three channels to make it an RGB image. Then you can modify the the col...

how to assign certain range of pixel values with desired color for classification of image?

What you need to do is replicate your grayscale image to three channels to make it an RGB image. Then you can modify the the col...

8일 전 | 1

답변 있음

Add a box with error metrics in plot

You can add information to a plot with an annotation, or you can use the rectangle and text functions. The code below will read ...

Add a box with error metrics in plot

You can add information to a plot with an annotation, or you can use the rectangle and text functions. The code below will read ...

11일 전 | 0

| 수락됨

답변 있음

Run cmd command from MATLAB

You should not set the PATH, but you should use cd instead to change the directory inside your system call. I personally pre...

Run cmd command from MATLAB

You should not set the PATH, but you should use cd instead to change the directory inside your system call. I personally pre...

12일 전 | 0

답변 있음

remove zeros from a 15x300 matrix and find the median

You can use this inside your loop. AS_V(i)= median(AS(AS~=0));

remove zeros from a 15x300 matrix and find the median

You can use this inside your loop. AS_V(i)= median(AS(AS~=0));

13일 전 | 0

답변 있음

Generate row vectors that match indexes

The code below will sample points over a parabola, since three points fully determine a second order polynomial. The middle poin...

Generate row vectors that match indexes

The code below will sample points over a parabola, since three points fully determine a second order polynomial. The middle poin...

18일 전 | 0

| 수락됨

답변 있음

How can I count the number of times a value occurs

You can use bwlabeln to label all your non-zero regions. then you can loop through each of the labeled regions to determine whic...

How can I count the number of times a value occurs

You can use bwlabeln to label all your non-zero regions. then you can loop through each of the labeled regions to determine whic...

18일 전 | 0

| 수락됨

답변 있음

How to set value in a matrix

This was a fun puzzle. I believe the code below is one of the many possible solutions. It does use implicit expansion, so for pr...

How to set value in a matrix

This was a fun puzzle. I believe the code below is one of the many possible solutions. It does use implicit expansion, so for pr...

19일 전 | 3

답변 있음

Why the line is not shown in the graph?

You are not indexing the trans variable inside your loop, which results in you overwriting the value every loop iteration. That ...

Why the line is not shown in the graph?

You are not indexing the trans variable inside your loop, which results in you overwriting the value every loop iteration. That ...

19일 전 | 0

답변 있음

how to plot smooth line plot?

The code below generates some example data and then interpolates the data in the loglog domain. %generate some example data X=...

how to plot smooth line plot?

The code below generates some example data and then interpolates the data in the loglog domain. %generate some example data X=...

19일 전 | 0

답변 있음

Need Help about this for loop

You are reusing i as a loop index multiple times. The mlint also warns you about that. It is a good idea to resolve all warnings...

Need Help about this for loop

You are reusing i as a loop index multiple times. The mlint also warns you about that. It is a good idea to resolve all warnings...

19일 전 | 0

| 수락됨

답변 있음

How to close the figure contain the uifigure after the alert is closed?

The figure you specify does not actually contain the alert. The function only requires an input to determine where the alert box...

How to close the figure contain the uifigure after the alert is closed?

The figure you specify does not actually contain the alert. The function only requires an input to determine where the alert box...

19일 전 | 1

| 수락됨

답변 있음

Adjust intervals of x-axis in the plot!

You can directly set the tick locations with the xticks function. Since your variable is already a datetime (and not datenum), y...

Adjust intervals of x-axis in the plot!

You can directly set the tick locations with the xticks function. Since your variable is already a datetime (and not datenum), y...

20일 전 | 1

| 수락됨

답변 있음

I need to scale the axes of a convolution function after plotting successive convolutions of x with itself. How do I scale the x axis for each so it has the correct support and how do I scale the convolutions to show that they are density functions?

Something like the code below should be close to what you want. Addapt as needed. y=ones(1,20); N=10; output=cell(N,1); ou...

I need to scale the axes of a convolution function after plotting successive convolutions of x with itself. How do I scale the x axis for each so it has the correct support and how do I scale the convolutions to show that they are density functions?

Something like the code below should be close to what you want. Addapt as needed. y=ones(1,20); N=10; output=cell(N,1); ou...

20일 전 | 0

| 수락됨

답변 있음

Vector averaging with mean command

A faster method than a for-loop is using movmean and throwing out the results you don't need. This will also take care of the ca...

Vector averaging with mean command

A faster method than a for-loop is using movmean and throwing out the results you don't need. This will also take care of the ca...

21일 전 | 1

답변 있음

Does matlab have any function that can compare multiple numbers and return logical value zero or one?

Another of the many strategies: count the number of elements a unique() call gives you. (when I'm back at a computer I'll test t...

Does matlab have any function that can compare multiple numbers and return logical value zero or one?

Another of the many strategies: count the number of elements a unique() call gives you. (when I'm back at a computer I'll test t...

23일 전 | 0