Respondida
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...

alrededor de 5 años hace | 0

Respondida
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 %...

alrededor de 5 años hace | 0

Respondida
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...

alrededor de 5 años hace | 0

Respondida
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 ...

alrededor de 5 años hace | 0

Respondida
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. ...

alrededor de 5 años hace | 1

Respondida
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...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

Respondida
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.

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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) ...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

| aceptada

Respondida
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 ...

más de 5 años hace | 2

| aceptada

Respondida
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...

más de 5 años hace | 1

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 1

Respondida
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 ...

más de 5 años hace | 1

Respondida
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...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 1

| aceptada

Respondida
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...

más de 5 años hace | 0

Respondida
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 ...

más de 5 años hace | 0

Respondida
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...

más de 5 años hace | 0

Respondida
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...

casi 6 años hace | 0

Respondida
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 ...

más de 8 años hace | 1

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Cargar más