Answered
For Loop does not work over a specified Range
When you execute commands like the following, if myNewVariable didn't exist before the elements in myNewVariable prior to elemen...

6 years ago | 0

Answered
read actual matrix value without rounding off
Use the format function to change how the matrix is displayed. This does not change the values that are stored in the matrix, ju...

6 years ago | 0

Answered
loading .mat files in 2020a
Are you trying to open the file in the MATLAB Editor? This is a data file, not a program file. You read the data stored in a MA...

6 years ago | 0

Answered
Hey guys i have a problem with arrray indexing.
Set an error breakpoint then run your code. When it stops, MATLAB will be paused in the location where the error occurred. To ma...

6 years ago | 0

Answered
Example of overloading times operator doesn't work
The * operator corresponds to the mtimes function. The operator for the times function is .* with the period in front. img2a = ...

6 years ago | 0

Answered
How to clear variable data but not remove the variable from workspace?
What do you mean by "empty"? Do you want to delete all the elements, thus eliminating information about the size of the variable...

6 years ago | 0

Answered
how to load .m funtion to my code?
I'm not 100% certain I understand the problem you're experiencing, but my guess is that you have a script file foo that defines ...

6 years ago | 0

Answered
loop and array for sum
The expression you use to calculate s doesn't depend on j and also doesn't depend on anything that changes inside the loop over ...

6 years ago | 1

Answered
Different kind of normalization
Use the normalize function.

6 years ago | 0

Answered
Array indices must be positive integers or logical values
You're missing the multiplication operator between By and (x2-3).

6 years ago | 0

| accepted

Answered
Test equality of two symbolic expressions
Ask MATLAB if those two symbolic expressions isAlways equal. >> syms a b >> x = sin(a + b); >> y = sin(a)*cos(b) + sin(b)*cos...

6 years ago | 0

| accepted

Answered
Passing formatted string output of sprintf to fprintf
format_str = sprintf('Saving the log file to: %s\n', dir) >> fprintf('%s', format_str) You don't want to use the string crea...

6 years ago | 0

Answered
Matrix with strings and numbers
I recommend converting A into a datetime array and using that to create a timetable array.

6 years ago | 0

Answered
Apply diff to function handle
>> syms x t x(t) >> dxdt = diff(x, t) dxdt(t) = diff(x(t), t) To substitute a function in for x(t): >> subs(dxdt, x, s...

6 years ago | 1

Answered
How do you output the values of temporary variables from a function when it runs?
You could modify the function so it also returns the "temporary" variables or you could debug your code.

6 years ago | 0

Answered
How to create a multidimensional array of fixed dimensions?
There's no such thing as the -25th column in an array in MATLAB, nor is there such a thing as the 1.5th column. You can make an...

6 years ago | 1

Answered
Random complete and in complete numbers
See the "Random Numbers Within Specified Interval" example on the documentation page for the rand function. doc rand

6 years ago | 0

Answered
Sum and Difference across row and column
You can do this with two simple sum calls and two basic arithmetic operations if you use the inclusion-exclusion principle. Sinc...

6 years ago | 0

Answered
Anybody using 2020a App Designer? Anything new or better of note?
The Release Notes for release R2020a list seven notes that contain the text "App Designer".

6 years ago | 1

| accepted

Answered
Is GUIDE option avaibale in MATLAB 2020?
GUIDE is still available in release R2020a, though as the note at the top of its documentation page and the entry in the Release...

6 years ago | 2

| accepted

Answered
How can i use linspace with different intervals?
If you know both endpoints and the interval, linspace isn't the best tool for the job. The colon operator (:) is. x = 0:0.1:0.9...

6 years ago | 0

Answered
Create a 1 x m Structure instead of a 1x1 Structure
Your second design looks less like a struct and more like a table. x = (0:11).'; y = x.^2; t = table(x, y) If you wanted a n...

6 years ago | 0

Answered
need some help with a function and calling it
Your function is defined to accept and use two input arguments. function SEK_ut = SEKDrive(x,y) %cost for the driving distance ...

6 years ago | 0

Answered
Timer on function, with variable output?
The TimerFcn for a timer cannot return an output. In which workspace would that output argument be stored? There's no guarantee ...

6 years ago | 1

| accepted

Answered
What is the purpose of defining a function like this?
I'm curious because the variables like Ffun and X0 are variables that i end up declaring in the body of the function anyway? D...

6 years ago | 0

Answered
unique function usage at interp1 interpolation
You make the elements in x unique (though maybe you intended to make x contain the unique data from x_data? That's not what you ...

6 years ago | 0

Answered
Finding mean values several times.
It sounds like the answer to the question you asked is movmean but you may not need to call movmean yourself. Take a look at th...

6 years ago | 0

Answered
Trouble with syntax and variable types in ODE45
When you use ode45 or any of the ODE solvers in MATLAB, all the functions that you pass into it (especially the ODE function you...

6 years ago | 1

Answered
MATLAB for Windows 7 32-bit
The last release of MATLAB supported on 32-bit Windows was release R2015b. According to the system requirements page release R20...

6 years ago | 0

Answered
How can I build a workaround for array bound exceeding?
Let's take an arbitrary DSM vector as an example. Your DSM vector may be different depending on how many random numbers you've g...

6 years ago | 1

Load more