Answered
[basic class syntax question] how can i fix this code
The add_3 method of the example2 class uses state information from an instance of the class that was passed into it. While Stati...

5 years ago | 1

| accepted

Answered
Normalize data set between 0 and 1
If you're using release R2018a or later, see the normalize function.

5 years ago | 0

Answered
ImageDataStore read issue -- works sometimes, sometimes not
If you try running imread inside a parfor loop rather than at the MATLAB prompt, does it throw an error? I'm wondering if the pa...

5 years ago | 0

Answered
Copy and paste current MATLAB code in another folder
Why are you trying to do this? If you're trying to modify the copy and later run the modified copy, I would instead have the fun...

5 years ago | 0

| accepted

Answered
Performance improvement array of class instances
I would probably create a method of the class that accepts an array of instances of the class and does the extraction / deletion...

5 years ago | 0

Answered
The question about subfigure size and property loop scripts
I would create a function that accepts data (and possibly an axes handle) and performs the necessary setup. The example below re...

5 years ago | 0

Answered
array indices must be positive intergers or logical values - not sure why i am getting this error message. same code worked for a friend of mine.
My guess is that earlier in that code you created variables named sum and/or mean. Attempts to call sum and/or mean while variab...

5 years ago | 0

Answered
List of version number for each ML version including numbered updates?
I'm curious how you would use this information if it was available. If you're planning to use it to ask "Are you using a version...

5 years ago | 1

| accepted

Answered
Does MathWorks have software for rocket trajectory modeling at supersonic speed?
I'd imagine that at least some of the applications described on the MATLAB and Simulink for Space Systems page required modeling...

5 years ago | 0

Answered
How to buy a new toolbox with a subscription running
Please contact Customer Support for official answers to these pricing and licensing questions.

5 years ago | 0

Answered
Loop Computation with i=1:N
What do you expect this code segment to do? sd=rng; phi(i)=normrnd(1,0.15); %G-distribution Draw rng=sd; If you expect ...

5 years ago | 0

Answered
How can i plot this function with factorial?
You haven't shown us what semilap is. If you intended for that to be the expression in lap evaluated at the points in xValues, y...

5 years ago | 0

Answered
How to display the correct output of the product of matrix correctly when i wanted to conver degrees to radians
The fprintf function will iterate through the elements of the second input you pass to it when determining how to fill the forma...

5 years ago | 0

Answered
Giving a moving point a chance to change path every step?
Rather than creating a large number of small line segments, you may want to look at either the animatedline function (and the ad...

5 years ago | 1

Answered
Why do I get Array indices must be positive integers or logical values?
t = [0:tl]; %snip a bunch of code, none of which changes t plot(x(t),y(t)) There's no such thing as element 0 of an array in ...

5 years ago | 0

Answered
How to insert an if conditional in ode45?
Don't use a conditional. Use an events function to detect when the condition occurs, stop the ODE solver, use the result from th...

5 years ago | 1

Answered
About the end used in vector append
% run the following code, there will be wrong % I wanna know why a=[]; a(end+1:2)=[8,9] % a(end+1:2)=[8,9] % wrong, why ...

5 years ago | 1

| accepted

Answered
Expected input number 2, edges, to be one of these types
function [chi2, critical] = chi2test (data, n, alpha, dist, a1, a2) prob = @(a,b) sprintf('cdf(''%s'', b, %10.10g, %10....

5 years ago | 0

| accepted

Answered
How can I run a specific version of matlab in non java mode using -nojvm?
You could specify the full path to the MATLAB executable that you want to launch either in the command prompt or in the target o...

5 years ago | 0

| accepted

Answered
Coordinates of nodes in plot graph
Copying my answer from this Answers post: B = graph(bucky); h = plot(B); X = h.XData; Y = h.YData; fprintf("Node 1 is locat...

5 years ago | 0

| accepted

Answered
Extracting data from a graph(directed graph.)
What "data of the nodes" do you want to retrieve? Do you want the coordinates of the plotted points? B = graph(bucky); h = plo...

5 years ago | 0

Answered
griddedInterpolant Error: Apparent Contradiction
Rather than using a separate report to debug this issue, set an error breakpoint. When it stops on a line where you create or us...

5 years ago | 0

| accepted

Answered
Replacing -999 in a table to NaN regardless of the type of the column
Let's take some sample data. x = randi([-10 10], 1, 10); Change three locations to -999. I also want to make a copy of x to ke...

5 years ago | 0

| accepted

Answered
Solving a Second Order Differential Equation
syms x t y(t) dx = diff(x, t) dy = diff(y, t) x is not a function of t so its derivative with respect to t is 0. y is a fun...

5 years ago | 0

Answered
What changed about matlab and tabs in a recent update?
tlines = sprintf('g1\t:\t14.203\t79.931\t50.598') split(tlines, '\t') % tlines{4} does not contain the characters \ and t spli...

5 years ago | 0

Answered
UI Figure windowstyle doesn't work - R2020a
The functionality you're trying to use was introduced in release R2020b. The online documentation is for the most recent release...

5 years ago | 0

| accepted

Answered
How can I define the number of output arguments for a matlab internal function like findgroups?
This is possible through the use of a comma-separated list. x = randi([-10 10], 1, 10) numOutputs = 2; theOutputs2 = cell(1, ...

5 years ago | 0

| accepted

Answered
How to plot already binned data
As written, you don't have counts so I would use histogram2 or histcounts2. % Create sample Hs and Tp matrices Hs = 15*rand(1,...

5 years ago | 1

Answered
colon expression to use integer operands
Seems to work fine for me. stepSize = (pi/512); thRadDbl = (0:stepSize:(2*pi - stepSize)); thRadDbl(1:5) There's no way you'...

5 years ago | 0

Answered
How to smooth out plotted points in a graph/figure?
Rather than creating one line per point I would consider using either scatter or one line per point color. xy = rand(10, 2); s...

5 years ago | 0

Load more