Community Profile

# Cris LaPierre

### MathWorks

1,641 total contributions since 2018

View details...

Contributions in
View by

Different colors for scatter plot points based on the difference of x-y values
You will need to come up with a vector that contains the values you want to use to set the color of the points. Once you have th...

7 hours ago | 1

| accepted

Creating a Table with rows labeled from a matrix and exporting it into an excel file
See this post. If you want row times, you might be interested in created a timetable instead of a table. We don't have your s...

9 hours ago | 1

| accepted

Loop how to sum part of matrix
Reshape your matrix to a 3x3x3 and then sum along the 3rd dimension.

12 hours ago | 0

2D contour plot from XYZ data
Creating 2D contours from xyz values

12 hours ago | 0

Looping matrice index at a specific interval, probably with mod
You could do something like this. This loop just creates an array showing the results. Each row would be the indices to use for ...

1 day ago | 1

| accepted

Index exceeds the number of array elements (1).
You can follow the steps provided in this answer to determine the issue.

1 day ago | 0

Index in position 1 exceeds array bounds (must not exceed 28).
I suspect the error is here: NLD(i,3) Position 1 is indexed by i. Since you are using a while loop, check what the value of i i...

1 day ago | 0

30 most frequent words with more than 4 letters in a text file
See the Analyze Text Data with String Arrays example.

1 day ago | 1

Running a for loop with breaks
First point - you are not using ginput. You are using ginputc, which is a function obtained on the file exchange. From the desc...

1 day ago | 0

how to solve not enough argument on the bold one?
You can delete the bolded line. [N,r]=size(X); It is not necessary. N and r are defined about 10-15 row above, and those are t...

1 day ago | 0

Reversing parts of (even) items in a listbox (cellarray)
You can use mod to determine if the last number is even or not. I would then use indexing to reverse the order of the rows that ...

1 day ago | 0

| accepted

How can I create a 2D contour Plot from X,Y,Z table?
The first issue is that one of your inputs to griddata is symbolic. It must be numeric. Use the double function to convert Qs1 t...

1 day ago | 1

| accepted

Where may I find documentation for the Day Count Convention actual/actual (basis value 0) from the Financial Toolbox
I believe it's described on the yearfrac documentation page. An explanation of the basis input is found here.

1 day ago | 0

| accepted

How to turn a script into a function so later i can make the code executable with Matlab Coder
+1 to what Rik said. However, this is a good opportunity to point out that the MATLAB live editor now has the capability of co...

2 days ago | 0

| accepted

Colorbar doesn't match with contourf plot
I believe the issue is that this data set doesn't lend itself well to a contour plot. 98.6% of the data is <10 or NaN. Your lowe...

2 days ago | 1

Index exceeds array bounds in BVP problem
Because i exceeds the length of Y_gHMX. I see your index relates to the values you extracted from Y_gHMX_. However, once extrac...

2 days ago | 0

Code Segment works in Command Window but not in script
Appears to work just fine. Do you define X or theta somewhere in your script with different dimensions? Perhaps clear your works...

3 days ago | 0

| accepted

-If else- conditionals in matlab app.designer?
Because your check of the menu value returns a value for each character, not one. a='ac'; a=='ac' You can use a single &, and...

3 days ago | 1

how to reset drop down list(go to first option) when pushing any other button in App designer
In the callbacks for those other buttons, add the following code. app.DropDown.Value = app.DropDown.Items(1);

3 days ago | 0

Animating plot in a for loop
Use the animatedline function. Follow this example from the documentation.

3 days ago | 0

| accepted

Adding a value to a vector
The same way. What have you tried? See Ch 6 of MATLAB Onramp. x=[ 1 2 3 ]; x=x + 4

3 days ago | 1

Diff function: How to calculate the difference of two values
Syntax error. See the doc page. You are asking it to take the diff of 12.22 13.22 times. All the values you want to take the dif...

3 days ago | 1

Error using findpeaks Expected Y to be one of these types: double, single Instead its type was table.
Best to use variable you define rather than ans. The function readtable returns a table. Each column of a table is, in turn, a...

4 days ago | 0

| accepted

Plot a 3d domain with colors determined by 3d array
I would use the following syntax for scatter3 scatter3(X,Y,Z,S,C) Note that if C is a vector with length equal to the length o...

4 days ago | 1

How to: sum up elements of a row vector into bins of a matrix
With a little creativity, you can use groupsummary. Since you haven't shared enough of your code to use that for an example, her...

4 days ago | 0

| accepted

4 days ago | 0

| accepted

Index exceeds number of array elements (1)
You might find the explanation I gave in this post helpful.

4 days ago | 0

| accepted

How do I convert a double into a cell array?
You can use num2cell. Use the transpose operator to convert a 30x1 to a 1x30. a=(1:5)' b=num2cell(a')

4 days ago | 0

| accepted

create a plot with two y - axis where the second one is just a reference scale.
I provided this solution for a similar request in add designer. Remove any "app." and "app.UIAxes," and it should work.

4 days ago | 0