Answered

Script: Indexing in function problem

Functions cannot be defined in the middle of your code. You will need to either place it at the bottom of your script, or in a s...

Script: Indexing in function problem

Functions cannot be defined in the middle of your code. You will need to either place it at the bottom of your script, or in a s...

2 days ago | 0

Answered

How to get files back from the cloud MATLAB Online?

MATLAB Drive is the file system used in MATLAB Online and MATLAB Mobile. You can access your files at drive.matlab.com. You cou...

How to get files back from the cloud MATLAB Online?

MATLAB Drive is the file system used in MATLAB Online and MATLAB Mobile. You can access your files at drive.matlab.com. You cou...

2 days ago | 0

Answered

How to make the x and y vector the same length

Take a look at the documentation for linspace. If you only input the start and stop values, linspace creates a vector with 100 ...

How to make the x and y vector the same length

Take a look at the documentation for linspace. If you only input the start and stop values, linspace creates a vector with 100 ...

2 days ago | 0

| accepted

Answered

getting error in simulink onramp "Matlab Function block 7.2"..Failed to evaluate mask initialization command..

You need to connect the Signal Assessment block to the output signal labeled "Power". However, when I tested without having it ...

getting error in simulink onramp "Matlab Function block 7.2"..Failed to evaluate mask initialization command..

You need to connect the Signal Assessment block to the output signal labeled "Power". However, when I tested without having it ...

2 days ago | 1

| accepted

Answered

Cannot load built-in Image Histograms example from App Designer window

I don't know why that would have happened. Reinstalling might fix the issue. You might check if the app is on your computer. It...

Cannot load built-in Image Histograms example from App Designer window

I don't know why that would have happened. Reinstalling might fix the issue. You might check if the app is on your computer. It...

2 days ago | 0

Answered

surface plot face not showing colors corresponding to Zgrid in some areas

This has to do with how surface plots are created. For an alterante explanation, see this post. Basically, your values are repr...

surface plot face not showing colors corresponding to Zgrid in some areas

This has to do with how surface plots are created. For an alterante explanation, see this post. Basically, your values are repr...

3 days ago | 0

Answered

plot3(X,Y,Z)

With plot3, you do not have to use meshgrid. Just create a vector a X values, a vector of Y values, and compute your Z values fr...

plot3(X,Y,Z)

With plot3, you do not have to use meshgrid. Just create a vector a X values, a vector of Y values, and compute your Z values fr...

4 days ago | 0

Answered

D'Agostino's skewness test

I'm not familiar with what R does, but you can see the algorithms used in MATLAB's skewness function here.

D'Agostino's skewness test

I'm not familiar with what R does, but you can see the algorithms used in MATLAB's skewness function here.

4 days ago | 0

Answered

Grayscale Image cannot be output in the GUI Matlab

The function rgb2gray returns an mxn matrix. However, as you can see in the error message, the image component in an app require...

Grayscale Image cannot be output in the GUI Matlab

The function rgb2gray returns an mxn matrix. However, as you can see in the error message, the image component in an app require...

4 days ago | 0

| accepted

Answered

Attempt to execute SCRIPT ... as a function:

The issue is that you are treating your script as a function. Functions have inputs, scripts do not. >> testfunktion(10) Just ...

Attempt to execute SCRIPT ... as a function:

The issue is that you are treating your script as a function. Functions have inputs, scripts do not. >> testfunktion(10) Just ...

4 days ago | 1

| accepted

Answered

I need help finding the mean/avg of my data set

I would use groupsummary for this. Keep your data in a table. We don't have your data to test with, but here's a simple examp...

I need help finding the mean/avg of my data set

I would use groupsummary for this. Keep your data in a table. We don't have your data to test with, but here's a simple examp...

5 days ago | 0

| accepted

Answered

Taking geo data and turn it into cartesian plot

Why not take your cartesian X,Y values, and convert them to lat/lon? Use the local2latlon function. You can then plot everything...

Taking geo data and turn it into cartesian plot

Why not take your cartesian X,Y values, and convert them to lat/lon? Use the local2latlon function. You can then plot everything...

5 days ago | 0

| accepted

Answered

why there are 0's in my matrix?

You predefine your matrix A as zeros. So when you get to an equation that multiplies the original value in A to create the new v...

why there are 0's in my matrix?

You predefine your matrix A as zeros. So when you get to an equation that multiplies the original value in A to create the new v...

5 days ago | 0

| accepted

Answered

HOW TO READ A .WRL FILE IN MATLAB?

The most obvious error I see is that you change the varialbe name when you append the '_'. You save that result to filename. You...

HOW TO READ A .WRL FILE IN MATLAB?

The most obvious error I see is that you change the varialbe name when you append the '_'. You save that result to filename. You...

5 days ago | 0

Answered

Why do I get "Array indices must be positive integers or logical values." Image processing.

You get that error because any time you use indexing to extract values from a variable, the index number must be integers >= 1. ...

Why do I get "Array indices must be positive integers or logical values." Image processing.

You get that error because any time you use indexing to extract values from a variable, the index number must be integers >= 1. ...

6 days ago | 1

| accepted

Answered

Indexing by year from full date

I'd convert your dates to datetimes. Then you can just use the year, month, and day functions.

Indexing by year from full date

I'd convert your dates to datetimes. Then you can just use the year, month, and day functions.

6 days ago | 0

| accepted

Answered

How do I convert a string to a datetime?

Assign your string to the variable my_string my_string = "19:00:06 01.04.20"; t=datetime(my_string,'InputFormat','HH:mm:ss dd....

How do I convert a string to a datetime?

Assign your string to the variable my_string my_string = "19:00:06 01.04.20"; t=datetime(my_string,'InputFormat','HH:mm:ss dd....

6 days ago | 0

| accepted

Answered

for loop in matlab

The values are changing because the indexing inside the for loop is telling it where to place the values. I'm going to direct ...

for loop in matlab

The values are changing because the indexing inside the for loop is telling it where to place the values. I'm going to direct ...

6 days ago | 0

Answered

How can I fill by color the paired boxplots?

You could use the "BoxStyle","filled" name-value pair. Note that, since the data is random, my plot won't look the same as your...

How can I fill by color the paired boxplots?

You could use the "BoxStyle","filled" name-value pair. Note that, since the data is random, my plot won't look the same as your...

6 days ago | 0

| accepted

Answered

How to plot 3D data in 2D graph

You could create a 3D plot, and then rotate it so you are just looking at the XY plane. You can do this using view(2). You could...

How to plot 3D data in 2D graph

You could create a 3D plot, and then rotate it so you are just looking at the XY plane. You can do this using view(2). You could...

6 days ago | 1

Answered

How to add strings to an array within a loop

If you are using strings, you can create this just using "+". legend_names = "Case_" + string(1:5)

How to add strings to an array within a loop

If you are using strings, you can create this just using "+". legend_names = "Case_" + string(1:5)

6 days ago | 1

| accepted

Answered

How to split tables and extract all data based on a column value?

See this page on how to access data in a table. You are close. Don't forget to include both row and column indices, and make th...

How to split tables and extract all data based on a column value?

See this page on how to access data in a table. You are close. Don't forget to include both row and column indices, and make th...

6 days ago | 1

| accepted

Answered

2-D plot

I suggest MATLAB Onramp. Ch 9 covers the basics of plotting. You'll also need Ch 12 (logical arrays).

2-D plot

I suggest MATLAB Onramp. Ch 9 covers the basics of plotting. You'll also need Ch 12 (logical arrays).

6 days ago | 1

| accepted

Answered

Trouble with while loop

You appear to have one too many ends in your code. That's not going to fix your infinite loop, but it needs to be fixed, too. U...

Trouble with while loop

You appear to have one too many ends in your code. That's not going to fix your infinite loop, but it needs to be fixed, too. U...

6 days ago | 0

Answered

How do I import the data correctly for it to accept it?

I'd suggest looking into how to load data from a text file.

How do I import the data correctly for it to accept it?

I'd suggest looking into how to load data from a text file.

6 days ago | 0

Answered

Drawing a tangent line on plot but keep getting the error "array indices must be positive integers or logical values"?

You need to include the multiply operator: y=k*(x-x1)+y1;

Drawing a tangent line on plot but keep getting the error "array indices must be positive integers or logical values"?

You need to include the multiply operator: y=k*(x-x1)+y1;

6 days ago | 1

Answered

How to plot values of a variable Z on an arbitrary 2D path in X and Y

Since you have the equation, just create vertors for X and Y of the line, then solve for Z using those values. Assuming that's ...

How to plot values of a variable Z on an arbitrary 2D path in X and Y

Since you have the equation, just create vertors for X and Y of the line, then solve for Z using those values. Assuming that's ...

7 days ago | 0

| accepted

Answered

how to plot the mean of values from swept data

Sure. Use groupsummary. Your grouping variable is your dependent variable, your method is 'mean', and your datavar is your indep...

how to plot the mean of values from swept data

Sure. Use groupsummary. Your grouping variable is your dependent variable, your method is 'mean', and your datavar is your indep...

7 days ago | 0

Answered

How to generate a colourmap for a 2D denisty map?

It looks like your comparison image has had the color axis manually adjusted (rt click on colorbar and select "Interactive Color...

How to generate a colourmap for a 2D denisty map?

It looks like your comparison image has had the color axis manually adjusted (rt click on colorbar and select "Interactive Color...

7 days ago | 0

| accepted