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 ...

14 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...

14 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...

14 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)

15 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...

15 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).

15 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...

15 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.

15 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;

15 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 ...

15 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...

15 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...

15 days ago | 0

| accepted

Answered
MATLAB Fundamentals course error
A couple things to try are using a different browser clearing your cache. To be honest, I'm not hopeful of either of these ma...

15 days ago | 1

| accepted

Answered
Log(x) equation does not plot correctly
Perhaps reading the error message you get on the screen will help explain the issue: Warning: Imaginary parts of complex X and/...

15 days ago | 0

| accepted

Answered
Surface plot not displaying full data range
I think there are a couple factors here. The mesh lines represent your data. The colored squares represent the space between yo...

15 days ago | 1

| accepted

Answered
how to import average of monthly data from excel file?
You would either have to create a separte sheet in Excel that first calculates the monthly average, or you will need to import a...

16 days ago | 0

Answered
Parse error at')':
You cannot define a function inside an if statement. If you want to include a helper function, ir must be defined at the bottom ...

16 days ago | 0

| accepted

Answered
problem with MATLAB Drive Connector
Have you tried contacting technical support? That appears to be the recommendation based on the error encountered.

18 days ago | 0

Answered
Generated Code from plot
It has created a plotting funciton for you. Once you save it, you can use it to recreate your plot. Since it is a function you w...

18 days ago | 0

Answered
How to read a text file where the data are merged to the first headline title
Random thought to try. If this is always the format (in particular, the first column is just row number), then try readmatrix or...

19 days ago | 0

Answered
1d function varies with time: plot
It would probably be a good use of your time to go through MATLAB Onramp. Ch 9 covers plotting, but it sounds like you might wan...

19 days ago | 0

Answered
Why do I get a warning " Name is nonexistent or not a directory : ... " in startup ?
I get this occassionally as well. A temporary folder gets added to the path and then doesn't get removed. You can just edit your...

19 days ago | 0

Answered
How to add NaN values to a matrix?
Use the missing function. % Define a 4x5 matrix A=ones(4,5); % Turn into a 4x9 A(:,end+1:9)=missing

19 days ago | 0

Answered
How to order matrix
Consider using sprintf or fprintf instead of disp. This allows you to set the formatting of your output.

19 days ago | 1

| accepted

Answered
How can I plot the orbit of Earth over the course of a year using Julian dates?
The error you shared is because you defined t_o (uses the letter O), but then try to calculate something using t_0 (uses the num...

19 days ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
This error means that your index variable i is either negative zero not an integer Check your code that you did not include ...

19 days ago | 0

| accepted

Answered
What is wrong in this code?!
Well, what are you seeing that is incorrect? Some suggestions - the code is formatted incorrectly, causing runtime errors. The...

19 days ago | 0

| accepted

Answered
How to create Ratio/percentile distribution plot
I'm not aware of something that would do this automatically, but it's pretty simple to update the y ticks of a histogram to do w...

19 days ago | 0

| accepted

Answered
How to find optimum data using PCA?
I feel you have a misunderstanding of what PCA does. It is useful for identifying the variables that can best be used to describ...

19 days ago | 0

Load more