Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values.

Your values are not integers. For example, what value should rat_ink(79.7,1) return? Valid indices are 1, 2, 3, etc.

Index in position 1 is invalid. Array indices must be positive integers or logical values.

Your values are not integers. For example, what value should rat_ink(79.7,1) return? Valid indices are 1, 2, 3, etc.

ungefär 19 timmar ago | 0

Answered

Change scale of second y-axis on figure

Use the ylim function to set the yaxis limits.

Change scale of second y-axis on figure

Use the ylim function to set the yaxis limits.

ungefär 19 timmar ago | 0

Answered

Error using sin Not enough input arguments

sin is a function, which means you must give it an input. The error here is with the code sin*t at the end of your expression. D...

Error using sin Not enough input arguments

sin is a function, which means you must give it an input. The error here is with the code sin*t at the end of your expression. D...

ungefär 19 timmar ago | 0

Answered

Convert a map in shapefile into occupancy map

I'll take the "offer a tip" route. That means I may not know what I'm talking about. I have some familiarity with shapefiles, b...

Convert a map in shapefile into occupancy map

I'll take the "offer a tip" route. That means I may not know what I'm talking about. I have some familiarity with shapefiles, b...

3 dagar ago | 0

Answered

How to find average value of every 10 numbers within a set of numbers?

The problem is how you set up your loops. The first value of i is the length of speed, 452. The first value of j is trying to i...

How to find average value of every 10 numbers within a set of numbers?

The problem is how you set up your loops. The first value of i is the length of speed, 452. The first value of j is trying to i...

4 dagar ago | 0

Answered

Using text, 2 variables, and decimals in fprintf

The documentation page is a great place to start. There, you'll see that the variables have to come at the end. Also, you don't ...

Using text, 2 variables, and decimals in fprintf

The documentation page is a great place to start. There, you'll see that the variables have to come at the end. Also, you don't ...

4 dagar ago | 0

Answered

Try catch error function not working

Your code must generate an error in the 'try' portion before it will execute what is in the catch. I don't see any reason why th...

Try catch error function not working

Your code must generate an error in the 'try' portion before it will execute what is in the catch. I don't see any reason why th...

4 dagar ago | 1

Answered

Help me to Solve ODE problem

Check your equations. Sr is always zero. This causes cst to always be zero, which then causes drdt to also be zero, causing dRdt...

Help me to Solve ODE problem

Check your equations. Sr is always zero. This causes cst to always be zero, which then causes drdt to also be zero, causing dRdt...

4 dagar ago | 0

| accepted

Answered

How can I read data from excel file consecutively rather than taking random numbers ?

Maybe I don't understand your question, or you don't understand your code. Your code tells it to load a random file, and then c...

How can I read data from excel file consecutively rather than taking random numbers ?

Maybe I don't understand your question, or you don't understand your code. Your code tells it to load a random file, and then c...

4 dagar ago | 0

Answered

Working with fileDatastore and loading its data

What is the name of the variable you are loading? That is a fieldname in the structure kost. You access it using dot notation: ...

Working with fileDatastore and loading its data

What is the name of the variable you are loading? That is a fieldname in the structure kost. You access it using dot notation: ...

4 dagar ago | 0

Answered

Extract X,Y data from scatter plot

Assuming you have a *.fig file and not a .png, first open the fig file in MATLAB then run the following code. s=findobj(gca,'Ty...

Extract X,Y data from scatter plot

Assuming you have a *.fig file and not a .png, first open the fig file in MATLAB then run the following code. s=findobj(gca,'Ty...

4 dagar ago | 0

| accepted

Answered

Array dimensions must match for binary array op.

The code runs just find for me. I don't have 'lake.tif', but I don't think that should matter. Try clearing your workspace or r...

Array dimensions must match for binary array op.

The code runs just find for me. I don't have 'lake.tif', but I don't think that should matter. Try clearing your workspace or r...

4 dagar ago | 0

| accepted

Answered

Saving data in separate folders under different file names

I notice the lengh of the vector used for i is 90, but the length of Filename is 88. I suspect what is happening is that, when y...

Saving data in separate folders under different file names

I notice the lengh of the vector used for i is 90, but the length of Filename is 88. I suspect what is happening is that, when y...

5 dagar ago | 0

| accepted

Answered

Unrecognized variable x error

What is the value of n? The most obvious thing to me is that your for loop doesn't actually run, so x is never created. The lo...

Unrecognized variable x error

What is the value of n? The most obvious thing to me is that your for loop doesn't actually run, so x is never created. The lo...

5 dagar ago | 0

| accepted

Answered

How can I display the sum of the digits of a number entered by a user?

See this post.

How can I display the sum of the digits of a number entered by a user?

See this post.

7 dagar ago | 0

Answered

Matlabonramp 13.2.

"Toggle" means to switch between to states (on/off, yes/no, in/out, show/hide, etc). A Further Practice section is an area to p...

Matlabonramp 13.2.

"Toggle" means to switch between to states (on/off, yes/no, in/out, show/hide, etc). A Further Practice section is an area to p...

8 dagar ago | 0

| accepted

Answered

plot 4 plots on 3 axes

Start by looking into yyaxis. As for adding a 3rd y-axis, see if this post helps.

plot 4 plots on 3 axes

Start by looking into yyaxis. As for adding a 3rd y-axis, see if this post helps.

9 dagar ago | 0

Answered

Datevector conversion from Excel to Matlab

I would read them in this way: data = readtable('datevec_raw.xlsx','ReadVariableNames',false);

Datevector conversion from Excel to Matlab

I would read them in this way: data = readtable('datevec_raw.xlsx','ReadVariableNames',false);

10 dagar ago | 0

| accepted

Answered

How can I to convert a cell to a double without losing the leading zeros?

I believe you would have to keep it a string in order to pad with zeros up front. See this post.

How can I to convert a cell to a double without losing the leading zeros?

I believe you would have to keep it a string in order to pad with zeros up front. See this post.

11 dagar ago | 0

Answered

Adding latex text to a curve in a matlab plot

Try using the text function and set the 'Interpreter' name-vale pair to 'latex'.

Adding latex text to a curve in a matlab plot

Try using the text function and set the 'Interpreter' name-vale pair to 'latex'.

11 dagar ago | 0

| accepted

Answered

How can I change my Matlab from Chinese to English on a Macbook with the latest version of Matlab

Does this link help?

How can I change my Matlab from Chinese to English on a Macbook with the latest version of Matlab

Does this link help?

14 dagar ago | 0

Answered

Loading a VERY inconsistent data

When I look at your file, it looks to be fixed-width, but you seem to have two different data sets combined here. The indicator ...

Loading a VERY inconsistent data

When I look at your file, it looks to be fixed-width, but you seem to have two different data sets combined here. The indicator ...

14 dagar ago | 2

Answered

How to open csv file?

There are many ways to import a csv file, including readtable textscan readmatrix csvread (not recommended) dlmread (not re...

How to open csv file?

There are many ways to import a csv file, including readtable textscan readmatrix csvread (not recommended) dlmread (not re...

14 dagar ago | 1

Answered

comparing table values using isequal

This can be done much simpler. Try something like this. A = M(M{:,2}=="f",:);

comparing table values using isequal

This can be done much simpler. Try something like this. A = M(M{:,2}=="f",:);

15 dagar ago | 1

| accepted

Answered

How to solve "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side" error?

x(j) is a single array element. You are trying to assign it 3 values, [dis0; phi0; theta0]. I'm unsure what the intent is, but o...

How to solve "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side" error?

x(j) is a single array element. You are trying to assign it 3 values, [dis0; phi0; theta0]. I'm unsure what the intent is, but o...

15 dagar ago | 0

| accepted

Answered

How can I count all occurances of each date in a DateTime Array?

I would look into groupsummary. Like Adam suggests, you'll need to remove the time portion for it to work as you intend. % Simp...

How can I count all occurances of each date in a DateTime Array?

I would look into groupsummary. Like Adam suggests, you'll need to remove the time portion for it to work as you intend. % Simp...

16 dagar ago | 1

| accepted

Answered

Is there a way to make the grid of latitude/longitude bolder when I use worldmap('World')

You could try something like this: % Code example with slight change (w=) w=worldmap('World'); load coastlines plotm(coastla...

Is there a way to make the grid of latitude/longitude bolder when I use worldmap('World')

You could try something like this: % Code example with slight change (w=) w=worldmap('World'); load coastlines plotm(coastla...

17 dagar ago | 0

| accepted

Answered

About Matlab r2020a online

Not sure we can answer your question without knowing what is in the course and whether or not you have access to MATLAB Online. ...

About Matlab r2020a online

Not sure we can answer your question without knowing what is in the course and whether or not you have access to MATLAB Online. ...

19 dagar ago | 0

Answered

Error: File: Lab1.m Line: 81 Column: 1 Function definitions in a script must appear at the end of the file. Move all statements after the "f" function definition to before the first local function definition.

What you have shared looks good, but you have not shared your full file (we do not see 81 lines, nor do we see a function f). As...

Error: File: Lab1.m Line: 81 Column: 1 Function definitions in a script must appear at the end of the file. Move all statements after the "f" function definition to before the first local function definition.

What you have shared looks good, but you have not shared your full file (we do not see 81 lines, nor do we see a function f). As...

19 dagar ago | 0