Answered
Making the if statement in a for loop display only one iteration of the message
Looks like it takes 25 iterations to converge. Are you looking for it to display at the very end a Success/Failure message? The...

nästan 4 år ago | 0

Answered
NEED HELP SOLVING "Array indices must be positive integers or logical values"
Does it need to be a one-liner? If you can grab the x,y coordinate, you could clamp your index points to the box bounds using %...

nästan 4 år ago | 0

Answered
Change Simulink parameters in Matlab function
Simulink will look for variables in MATLAB's base workspace by default. Since var1 and var2 are defined in the function's worksp...

nästan 4 år ago | 0

Answered
Error with an empty array - Subscript indices must either be real positive integers or logicals
You're subscripting a logical IXY, which will only retrieve indices that evaluate to true from HEIGHTS. Is it possible that all ...

nästan 4 år ago | 0

Answered
Grabbing Years of table data to Create New Tables
A fast solution might be to use the Timestamp to extract the date for each row and then use the group capabilities of tables. ...

nästan 4 år ago | 1

Answered
I need help with step function
Hi Anna, The (unit) step function is basically a function that goes from 0 to 1, generally at time 0, scaled by whatever magnit...

ungefär 4 år ago | 0

Answered
Problems With Function Error
Up until recently, MATLAB had a requirement to separate scripts from functions. A file could hold one but not both types. Now, i...

ungefär 4 år ago | 0

Answered
Assigning or replacing elements of another array into an array based on indices
Ali, I suggest you use logical indexing for this instead of FIND. It's faster and a little cleaner. Hope this helps! b = [0 ...

ungefär 4 år ago | 0

Answered
Error using figure First argument must be a figure object or a positive Integer
Figure is a function. Try: figure(4) This should activate a figure with ID number 4.

ungefär 4 år ago | 0

Answered
Run Simulink Model as a Function
Hi Sze, To clarify, you're hoping to run a simulink model from within a call to ODE45? While possible, I'm afraid this is goi...

ungefär 4 år ago | 0

| accepted

Answered
find max value of structure
If I'm understanding correctly, you have a struct array, s, of size 1x30, with a single field (let's call it x). Something like...

ungefär 4 år ago | 0

Answered
Derivative from ode45
Generally I send the result of ode45 back through my function as a post-processing step. [t,x] = ode45(@myDerivFcn,tspan,x0) ...

mer än 4 år ago | 0

Answered
How to solve two differential equations simultaneously with one having a matrix form of initial condition?
Hi Adham, Just to be clear, it's an ordinary differential equation, is /? If so, and each matrix term is separable, then you ...

mer än 4 år ago | 0

| accepted

Answered
Problem with xlim when having date
Hi Behzad, xlim sets the absolute max and min of the graph that you're looking at. To set the interval for grid lines, use the ...

mer än 4 år ago | 2

| accepted

Answered
Running ode45 from problem statement
Hi Daniel, For your problem, you were very close and had the solutions to each equation worked out correctly. The function sign...

mer än 4 år ago | 1

| accepted

Answered
please help me, how do I make the code for the equation in the following picture?
You can't code an infinite sum exactly, but fortunately, this one is bounded (x^2 on the denominator and the numerator is bounde...

mer än 4 år ago | 0

Answered
Sort data based on different column
Try using the sortrows command in conjunction with a transpose. Apply it once to exploit column sorts (e.g. Column 1 is Row 1 ab...

mer än 4 år ago | 0

| accepted

Answered
Mimicking the font that title() uses when calling it with latex interpreter
Try using the Tex interpreter with the \bf switch? title('\bf\nabla TITLE','Interpreter','tex') seems to get the bold you're lo...

mer än 4 år ago | 0

Answered
How can I find correlation between two variables X & Y which I have obtained experimentally?
Three points will give you a line, but I'd be hesitant to call it a trend. In general, linear regression of X and Y gives you a ...

mer än 4 år ago | 1

Answered
Evaluating function handle with array input arguments
Are you specifically looking at a binomial expansion? If so, there's a trick for composing that. For a generalized "raise this ...

mer än 4 år ago | 1

Answered
Combine graphs from different script (directory)
Like you thought, the cleanest process is to write a 5th script which will do as you've written above. If the code is easily con...

mer än 4 år ago | 0

Answered
Running/testing scripts on multiple Matlab/Simulink versions?
MATLAB can run in a headless mode from the command line, where it can take a script to execute. It's been a while since I've don...

mer än 4 år ago | 0

| accepted

Answered
How to read and arrange certain data in multiple text file?
This seems like a good opportunity to leverage MATLAB's table datatype: https://www.mathworks.com/help/matlab/ref/table.html U...

mer än 4 år ago | 0

Answered
Where can I find syntax related with 'Simulink.Parameter', 'Simulink.Signal' and 'Simulink.CoderInfo'
Check the documentation page: https://www.mathworks.com/help/simulink/slref/parameter.html Simulink Parameters function a litt...

mer än 4 år ago | 1

| accepted

Answered
Passing variables in GUI vs. assignin then evalin
Nested Functions are your favorite friend when working with GUIs. Place the callbacks within the main UI, and they'll be able to...

mer än 4 år ago | 0

Answered
Trouble creating function out of variable in terms of x
Is there any particular reason it needs to be using symbolic math? MATLAB has a built-in polynomial evaluation function called ...

mer än 4 år ago | 0

Answered
How to make Ellipse rotates around focus
Haoang, Are you looking to have the ellipse rotate in a plot? You might be interested in applying a rotation matrix. See: ht...

mer än 4 år ago | 0

Answered
Matlab Plotting with out legend
Check out the textbox() or annotation() commands. Text objects are placed inside the plot, while annotations are placed on the f...

mer än 4 år ago | 0

Answered
How do I repeat a character n times?
Because your histogram counts will result in variable length strings of asterisks, you'll need to use cell arrays to store each ...

mer än 7 år ago | 1

| accepted

Answered
Cropping greyscale image based on pixel
The quick-n-dirty way that comes to mind is to just use a bitmask: 0 to toss a pixel's value and 1 to keep it. It's a little mem...

mer än 7 år ago | 0

| accepted

Load more