Community Profile

photo

Cris LaPierre


Last seen: en dag ago

MathWorks

1 806 total contributions since 2018

Cris LaPierre's Badges

  • 12 Month Streak
  • Guiding Light
  • Thankful Level 2
  • Revival Level 4
  • Solver
  • Knowledgeable Level 4
  • First Answer

View details...

Contributions in
View by

Answered
"parse error at '=': usage might be invalid MATLAB syntax." on lines 34 and "parse error at END: usage might be invalid MATLAB syntax" on line 37. Please help! Thanks!
You have used the wrong syntax to declare your function. Expected syntax is function ave = average(x) ave = sum(x(:))/nume...

ungefär 17 timmar ago | 0

Answered
Can i run matlab 2020b version code in 2020a ?
The documentation will refer to the latest version of MATLAB, which is currently 20b. This example was included in R202a as well...

ungefär 22 timmar ago | 0

| accepted

Answered
How to split an array into individual values for passing them into a multiple input function?
If the function has 3 input arguments, MATLAB expects each input to be separated by commas. The way I would do this is to pass i...

en dag ago | 0

Answered
How to exclude weekend data from an excel sheet in matlab?
You have mixed data in your columns, so the way I would do this is as follows. Use readtable to load the first two rows. I'm go...

2 dagar ago | 1

| accepted

Answered
how to get the value from .mlapp file in .m file and after some processing in .m file again return to .mlapp file to display the result on GUI interface
What you are describing is a function. You can read about the basics here. You can add a function in app designer. See this pag...

3 dagar ago | 0

Answered
365 day loop for 59 years
Make sure your dates are datetimes. Then you can take advantage of the dates and time functions. Here's a rought outline. star...

3 dagar ago | 0

Answered
Check if Lat, Lon coordinate fall inside a polyshape Polygon
I think your inputs to inpolygon need to be the points. Try using the inputs to polyshape. inpolygon can test a vector of query ...

4 dagar ago | 0

| accepted

Answered
Simplifying 4 for loops into one
Why not just put it all in one loop? listCGS = nan([5 1]); listMGS = nan([5 1]); listHouse = nan([5 1]); listMat = nan([5 1]...

4 dagar ago | 0

| accepted

Answered
Group data in bins
In that case, i would look into grpstats or groupsummary. You might also be interested in using findgroups in conjunction with s...

4 dagar ago | 0

Answered
Copying and pasting in matlabonline
Copy/paste does not appear in the rt click context menu. You should be able to use the appropriate keyboard shortcuts for your s...

4 dagar ago | 0

| accepted

Answered
Interpolating missing values according to time vector
Sure. You just have to separate your knowns and unknowns. x=[2 6 8 10 NaN NaN NaN NaN 21 59 NaN 12 80]'; time=[738097.24, 7380...

4 dagar ago | 1

| accepted

Answered
Reading the numeric columns from a mixed data type file
Look into readtable. Tables support mixed data types, and will use the headers as the variable names. You could also use the Im...

5 dagar ago | 0

Answered
HOW TO PLOT DATA BASED ON DATA IN ANOTHER COLUMN
What type of plot do you want? If a scatter plot, use gscatter. % Create data A=[randi(2,100,1),rand(100,1),rand(100,1)]; A=s...

5 dagar ago | 0

Answered
Creating an array from a matrix based on if statement outputs
As my opinion, based on what you have described, I would not use a for loop or an if statement. Doing so does not take advantage...

5 dagar ago | 0

Answered
Group data in bins
The first output of histcounts is the count of items in each bin. You could use this syntax to at least determine which bin ea...

5 dagar ago | 0

Answered
PROBLEM ANIMATING SURF PLOT
You are only modifying t. If you want something to change in another direction, you will have to modify the corresponding variab...

6 dagar ago | 0

Answered
How to continue an if statement after using the switch function
Right now, your second if statement is part of the otherwise case of the switch statement. If you want it to execute after the s...

6 dagar ago | 1

| accepted

Answered
Reading text file in Matlab
I wonder if it would make more sense to try to use the OpenEarthtools toolbox rather than try to create your own input function....

7 dagar ago | 0

| accepted

Answered
legend() has an issue with 'Selected' or 'selected'
The problem here is that 'selected' is being interpreted as the name of a name-value pair. Change you legend labels to a cell a...

7 dagar ago | 0

| accepted

Answered
Creating a function that prints the first multipliers of any number
https://www.mathworks.com/help/matlab/matlab_prog/create-functions-in-files.html https://www.mathworks.com/help/matlab/ref/func...

7 dagar ago | 0

Answered
A function that receives a vector and and returns specific metrics
https://www.mathworks.com/help/matlab/matlab_prog/create-functions-in-files.html https://www.mathworks.com/help/matlab/ref/func...

7 dagar ago | 0

Answered
How do I make my bar3h work as intended?
A bar plot colors by series, not by height of the bar. If you remove the caxis command, you will see the colors correspond to th...

7 dagar ago | 0

| accepted

Answered
ERROR:NOT ENOUGH INPUT ARGUMENT IN LINE n = length(y);
Based on what you've shared, you are trying to take the length of a variable that doesn't yet exist (y). That would give a diffe...

7 dagar ago | 0

Answered
Legend And Plot Disagree
The problem is related to yClassical being a matrix instead of a vector. When using ones, if you only specify one input value, n...

7 dagar ago | 1

| accepted

Answered
Using "fit" function to create a fit type and fit a curve with a function I created
There is a subtle detail made in this example. Define a function in a MATLAB file. Save the file. To use the approach you are...

7 dagar ago | 1

| accepted

Answered
Can someone help me with this error message: Error using vertcat Dimensions of arrays being concatenated are not consistent. ? My code is attached below
This error occurs when you try to combine (stack) vectors with different number of columns. a=1:3; b=2:8; c=[a;b] Check that...

7 dagar ago | 0

Answered
How to detect which type of data user selected 'text' or 'excel' file via "uigetfile" and then perform further code?
Use this syntax of uigetfile [file,path,indx] = uigetfile Here, indx corresponds to what filter was selected (see here). If th...

7 dagar ago | 1

| accepted

Answered
Import a spreadsheet with columns containing both string and numeric values using readtable()
In this instance, MATLAB has selected a numeric data type for the column. You can use the optoins to change the data type used t...

7 dagar ago | 0

| accepted

Answered
Help with writing Assessments for Script-Based Learner Solutions
I would suggest looking at the Assessment section of the Add Problem documentation page. If you have not done so already, I wou...

7 dagar ago | 0

Answered
How to import all sheets of excel file with "UIgetfile" option?
Use uigetfile to select the file. Then use that name in your second code to import all the sheets. Maybe something like this (un...

7 dagar ago | 1

| accepted

Load more