Answered
is this repr.m redundant to existing standard approach?
If all you really care about are numeric matrices containing "nice" values, consider mat2str. mat2str((1:5).^2) If you're doin...

6 years ago | 0

Answered
Conditional loop to loop until result is an integer.
If 2n/k = a and you want to find n and a, rewrite this as 2n/a = k. So you want to return two integer matrices whose ratio is "...

6 years ago | 1

Answered
Macbook air M1 - will 2018 or 2019 matlab releases work?
See this Answers post.

6 years ago | 0

Answered
error with sqrt in Matlab
The sqrt function is not defined for variables of the int64 data type. The square root of an integer value is not necessarily it...

6 years ago | 1

Answered
ode45 too many input arguments
Let's check if you're using the ode45 function included in MATLAB. What does this function show? It should show just one functio...

6 years ago | 2

Answered
varfun applied to table not recognising equal values
Are you sure the values are equal? They could be displayed as the same value without the stored value being the same. dt1 = dat...

6 years ago | 0

| accepted

Answered
How to change figure properties for all figures in MATLAB?
You can set default property values for graphics objects that are created in the future. Changing the defaults will not change t...

6 years ago | 0

Answered
How to do a same function on variables with similiar parts in their names?
let's say we have variables named as: Time_p1 and Voltage_p1 Time_...

6 years ago | 0

Answered
Curve fitting real functions
There is a collection of library models that can be used with functionality in Curve Fitting Toolbox. One type of model included...

6 years ago | 0

| accepted

Answered
+ or - Bias Based on < or >
I suspect at least one of AccelLateral_PT and AccelLateral is not scalar. From the documentation page for the if keyword: "An ex...

6 years ago | 0

Answered
How to store functions in a array
The anonymous functions do "remember" the value the variable i had when they were created, even if they don't show it. If you wa...

6 years ago | 1

Answered
Coupled system of ODE's using ode23
There are a couple problems and at least one area for improvement for your code. I'll be referring to several sections of the do...

6 years ago | 0

Answered
2 x 2d histograms from hist3
Let's say you had this 2-dimensional histogram. xy = [1 1; 1 1; 1 1; 1 -1; 1 -1; -1 1; -1 1; -1 -1]; histogram2(xy(:, 1), xy(:...

6 years ago | 0

Answered
How can I set a global variable in public properties App Designer that depends on another one?
When defining properties' default values, you can only use the values of other properties if those properties are Constant. To a...

6 years ago | 0

| accepted

Answered
problem in matlab for sin and cos
Since t and d are vectors I would create a 3-D array instead of a wide matrix. First turn t and d into 3-D arrays. t = reshape(...

6 years ago | 1

Answered
can someone explain to me this code line by line cuase im lost, i know the point of it but i cant figuret out
That would seem to be a question for the person from whom you obtained the code. If it's code from a textbook for a class you're...

6 years ago | 0

Answered
From discrete dates to continuous dates (revised)
Here's a sample timetable. dt = datetime(2020, 1, [1; 5; 12]); T = timetable(dt, [100; 40; 300], 'VariableNames', "visitors");...

6 years ago | 0

| accepted

Answered
For Loops with Multiple Arrays
m = [1:1:11]; r = [1:1:100]; z = [0:1:50]; whos The variable m is a 1-by-11 vector. The variable z is a 1-by-51 vector. What...

6 years ago | 0

Answered
Keep on getting 'Error using plot, Vectors must be the same length'. How can I plot it correctly?
Looking at a portion of your code with other parts cut out: % snip while h_check >= -0.5 % snip a(i+1)= - ...

6 years ago | 1

Answered
Array dimensions not consistent
%differential equations dcdt = [ (CA0-C(1))/tau -(-rA); (CR0-C(2))/tau+rR ; (CS0-C(3))/tau + rS]; The space before t...

6 years ago | 0

| accepted

Answered
please <<how can i define the inputs of this algorithm to matlab script ? also i dont know how to code line 5?
MATLAB script files do not and cannot accept input arguments. MATLAB function files can. See this documentation page for informa...

6 years ago | 0

Answered
Change logical operator of a while loop depending on value outside of the loop
for x = [1 2] if x == 1 compare = @gt; % > else compare = @lt; % < end if compare(2, 3) ...

6 years ago | 0

Answered
Getting x for a given y value from a cfit object
x = 2*rand(20, 1); y = 1.25*sin(x+0.3+rand(size(x))); f = fit(x, y, 'sin1') desiredy = 0.75; fun = @(x) desiredy - f(x); de...

6 years ago | 0

Answered
I have a homework assignment to create a final course grade calculator
Right now, the only place you assign a value to the QuizScore variable is inside the for loop that runs from 1 to the number of ...

6 years ago | 0

| accepted

Answered
triangle edges , triplet
function myList = rightTriangleEdges(listOfIntegers) clear all; close all; clc; These three commands should IMO almost never a...

6 years ago | 0

Answered
Find regular numbers 2^i 3^j 5^k
You cannot create functions by copying and pasting the code starting with the function keyword at the prompt in the Command Wind...

6 years ago | 1

Answered
How to use fwrite with a format subject to change
Since you're already storing your data in a table array, why not just use writetable?

6 years ago | 0

Answered
Lowess smoothing disappears in Curve Fitting App
According to this documentation page lowess is supported for surface fitting, not curve fitting. So if you specify x, y, AND z d...

6 years ago | 0

| accepted

Answered
Undefined function 'minus' for input arguments of type 'function_handle'. Error in flow1d2phase (line 46) Sw_shock = fzero(@(Sw)(dfw(Sw)-(fw(Sw0)-fw(Sw))./(Sw0-Sw)), 0.5);
Se = @(Sw)((Sw-Swc)/(1-Swc-Sor)); dSe = 1/(1-Swc-Sor); krw = @(Sw)0.5*(Se).^(6)+0.03*Se; There are a couple places where you ...

6 years ago | 0

Answered
How to align two columns each with their own time
Read your data into two timetable arrays then synchronize them. See the "Create Timetables" and "Resample and Aggregate Data in ...

6 years ago | 0

| accepted

Load more