Answered
Using stem plot for two plots
This looks like a reasonable plot to me. T=4e-3; n=21; x=linspace(0,T/2,2001); x1=linspace(T/2,T,2001); y=sin(pi*x/T); y1=(...

4 years ago | 0

Answered
using same variable for two separate button to run and show the output
There's no variable named t in the workspace of the plotButtonPushed function. If you had used app.t in that code, that would r...

4 years ago | 0

Answered
Moving Average with Variable Window Size
See the "Sample Points for Moving Average" example in the documentation page for movmean. While that example has uniformly space...

4 years ago | 1

| accepted

Answered
Phase Portrait of ODE system
You could use ode45 with the 'OutputFcn' option set to @odephas2 using odeset, as shown in this Answers post.

4 years ago | 0

Answered
Which file Matlab selects if two different files with the same name are put under two folders, which are both added via addpath?
See this documentation page for a discussion of the function precedence order.

4 years ago | 0

Answered
Matlab plot3 not giving a 3D plot
Since no axes existed when you called hold on, MATLAB created one using the default 2-D view and "locked" that axes property in ...

4 years ago | 1

| accepted

Answered
Mean and Median of Values in a matrix
Take a look at the groupsummary function.

4 years ago | 0

Answered
Error using crossvalind (line 131) Not a valid method.
According to the documentation page for crossvalind the value of the first input (listed as cvMethod on that page) that selects ...

4 years ago | 0

Answered
Computing mean by group (need help with speed!)
Since this question was asked (in release R2018b) we introduced the grouptransform function. I believe using the 'meancenter' me...

4 years ago | 0

Answered
Create structure from string name / Rename structure from string name
Use a fixed name for your struct and user-specified names for the fields, then when you save it use the -struct option. Let's ge...

4 years ago | 2

| accepted

Answered
creating a Dummy variable from a string vector
Use the string manipulation and/or set membership functions. Let's start with a random set of names: rng default D = ["Doc"; "...

4 years ago | 0

Answered
Data type of UIAxes change in R2022a?
I'm not certain offhand but I suspect that's a consequence of the changes made in release R2020b.

4 years ago | 0

| accepted

Answered
which my mistake erro
I suspect that you want those last two lines to be: [Efmax,Iter]= max(Ef); I2me=I2(Iter); in order to set I2me to the value o...

4 years ago | 1

Answered
what versions of matlab can work with the ROS toolbox
According to the second page of the Robotics System Toolbox User's Guide PDF file, version 1.0 of this toolbox was released as p...

4 years ago | 0

Answered
How do I view the properties of an abstract class?
Call the properties function with the name of the Abstract class as input. >> properties AbstractClassDemo Properties for clas...

4 years ago | 0

| accepted

Answered
Patenting a Matlab script
You're unlikely to get a definitive answer to a legal question, especially a very broad one like this one, here on MATLAB Answer...

4 years ago | 2

| accepted

Answered
Output argument "name of variable" (and possibly others) not assigned a value in the execution with "function name" function. Can someone explain what this means?
Another common cause of this error is that the function contains at least one code path on which the output variable is defined ...

4 years ago | 0

| accepted

Answered
using Repmat function , obtain repeated specific values
Use repelem. a = [1 2 3 4] b = a.^2 c = repelem(b, a)

4 years ago | 0

| accepted

Answered
What is this statistical chart called? Is there a corresponding MATLAB command? Thank you
Looking on the Plots tab of the Toolstrip and scrolling down to the Statistics and Machine Learning Toolbox Plots section (assum...

4 years ago | 0

| accepted

Answered
Get datenum to return missing instead of throwing an error
As @Cris LaPierre said, we recommend using datetime instead of datenum. Let's create some example data. t = string(datetime('to...

4 years ago | 1

Answered
Why is the function 'oldInlierLocation' undefined?
You made at least one mistake copying the code from around 4:10 in that video. Your code: if(nnz(isValid>=2)) The video's cod...

4 years ago | 1

| accepted

Answered
Is it not possible to create a web app using matlab 2018 b?
According to the Release Notes Web App Compiler was introduced in MATLAB Compiler in release R2018a.

4 years ago | 0

Answered
Some button in standalone app not working after being compiled (although code working well)
I believe if you launch the application from a system command prompt (Command Prompt on Windows, for example) rather than double...

4 years ago | 0

| accepted

Answered
I don't have acces to the Model Based Systems Engineering for Space-Based Applications template
I don't really understand since I have all modules and latest versions of matlab. Are you certain? Let's check. Run the followi...

4 years ago | 0

Answered
How to find x values from y value in "fit" function?
Set up a sample polynomial fit. x = randn(10, 1); y = (x-1).*(x+1); % polynomial is y = x^2-1 = (x-1)*(x+1) p = fit(x, y, 'po...

4 years ago | 0

Answered
Plotting phase space for 2nd order nonlinear ODE
See this Answers post for an example that sounds like what you want to do.

4 years ago | 0

Answered
How do you make it so that the simplify function displays the correct answer?
syms s simplify((s+30)*(s^2-20*s+200)) expand((s+30)*(s^2-20*s+200))

4 years ago | 1

Answered
Plot all polyshapes in cell array
If you've already created them in a cell array you can simply turn that cell array into an array of polyshape objects and plot t...

4 years ago | 0

Answered
Append indices to vector from container map
Like Walter suggested I'd use a digraph for this sort of operation. You can build a digraph from your containers.Map object. Let...

4 years ago | 1

Answered
Problem Creating Structure Field with For Loop
Do you want the names of the fields in the struct array to be file_name_ followed by a number (file_name_1, file_name_2, etc.)? ...

4 years ago | 0

Load more