Answered
Error: Function definition not supported in this context. Create functions in code file.
In a classdef file, functions that you want to be methods of the class need to be in a methods block. Note that in the example i...

5 years ago | 1

| accepted

Answered
error with sprintf add operation between 2 terms resulting in string
Do you want to concatenate a number and a piece of text together? a = '1234'; % a is a char vector b = 5; c = [a, num2str(b)]...

5 years ago | 1

Answered
How to fix it ? Warning: Do not specify equations and variables as character strings. Instead, create symbolic variables with syms. > In solve>getEqns (line 455) In solve (line 227)
As per the warning at the top of the documentation page for the dsolve function: "Support for character vector or string inputs ...

5 years ago | 0

| accepted

Answered
Subplot with table of datetime and double
Turn your table arrays into timetable arrays using table2timetable. Once you have a collection of timetable arrays, synchronize ...

5 years ago | 0

| accepted

Answered
convertion ECG signals to IEEE754
If your signals are stored as double or single arrays, congratulations you're done. They are stored in IEEE 754 double precision...

5 years ago | 0

Answered
Can I tell Matlab not to use contiguous memory?
You know, I really want to read the newest Brandon Sanderson novel. But I don't have room on that shelf in my bookshelf for the ...

5 years ago | 1

Answered
How to implement mass balance in ODE solver?
I think you could adapt the Robertson problem example from this documentation page.

5 years ago | 0

| accepted

Answered
Using a For Loop to combine a range of bins in a histogram
Create one histogram and retrieve the edges of the bins. x = randn(1, 100); h = histogram(x, 11, 'FaceColor', 'k'); % use 11 b...

5 years ago | 0

Answered
Moving sum of 4 subsequent observatins
Use the movsum function.

5 years ago | 0

| accepted

Answered
Clock jumps forward and back in time
My guess is that you're encountering the situation described at the end of page 7 of the chapter on ODEs in Cleve's Numerical Co...

5 years ago | 0

| accepted

Answered
Cant figure out the "reshape" function
As others have said, reshape reshapes the data in the array down columns then across rows and out pages. A = 1:24; B = reshape...

5 years ago | 1

Answered
for loop doesn't repeat the operation (Matlab)
Notice that the first n in the line "n = n+1;" is underlined? If you hover over that variable, you will see a Code Analyzer mess...

5 years ago | 0

Answered
Insert multidimensional array into function handle
syms c o = [ c 0 0; c 0 2; c 1 1; c 1 2; c 2 2; c 2 3; c 3 0; c 3 1; c 3 2; c 3 3 ]; f = @(c,x,y) c.*(x+y); % Use element-wise...

5 years ago | 1

| accepted

Answered
Converting a Column to Numeric for Date/Time Format
If you use the Import Data tool (in the Variable section on the Home tab of the toolstrip) you can import the data directly as a...

5 years ago | 1

| accepted

Answered
Is there a way to call a part of a function using an index?
Do you mean you want to plot position6(1) versus position6(2) in the first call, position6(3) versus position6(4) in the second,...

5 years ago | 0

Answered
How do I convert fractional display to decimal display ?
Call double or vpa on your symbolic variable.

5 years ago | 1

| accepted

Answered
IEEE 754 Double-Precision and Machine Epsilon
From this post on Cleve Moler's blog: "Either eps/2 or eps can be called the roundoff level." You're using eps/2.

5 years ago | 0

| accepted

Answered
MATLAB Live Script Editor Change Font
As of release R2021a you can change the Live Editor font settings programmatically.

5 years ago | 4

Answered
un-mix a pdf
So you want the local peaks? Take a look at the islocalmax function.

5 years ago | 0

Answered
symbolic math tool box
Symbolic Math Toolbox is not supported for use with MATLAB Compiler. There is no way to make this work. Depending on what you'r...

5 years ago | 0

Answered
How to extract powers of a symbolic polynomial?
syms z y = 0.96*z^3500 + 0.04*z^0 [coefficients, powers] = coeffs(y) syms y positive exponents = simplify(subs(log(powers)./...

5 years ago | 2

Answered
MATLAB not able to make calculation - array limit
The maximum of the sum of an element from A and an element from B (which is what I think you want, not what you're doing) is the...

5 years ago | 0

| accepted

Answered
Private properties inherited from abstract properties
So you only want the superclass and the subclass methods to have access to it? Set its Access, GetAccess, and/or SetAccess attri...

5 years ago | 0

| accepted

Answered
MATLAB code error clarification
Your CalcMeasures function requires you to call it with at least one input argument. You called it with zero input arguments. Be...

5 years ago | 0

| accepted

Answered
For loop iteration issue
Loop through elements? A = magic(4); s = 0; for elt = 1:numel(A) s = s + A(elt); end fprintf("The sum of elements in a 4-b...

5 years ago | 1

Answered
"Unrecognized function or variable" error when using fminbnd on an anonymous function
h is already a function handle, there's no need to try to make it one again. f1 = @sin; % Regular function handle f2 = @(x) x....

5 years ago | 1

Answered
PLEASE HELP ME!! :(
I would turn your y into a function. Rearranging your code a bit: fplot(@(x) x,[0,2],'m-') hold on % SL: I used repmat to a...

5 years ago | 0

| accepted

Answered
loading and convertion values in a text file to IEEE754 so as toobtain IEEE results in tabular form
What do you mean by "convert ... to IEEE754"? Do you mean that instead of seeing the numeric value: format longg x = pi you w...

5 years ago | 0

Answered
Compatibility of Matlab with IEEE-754 1985 or 2008
Is MATLAB compatible with IEEE-754 1985 or 2008 ? There are a few operations for which the IEEE specs state what the answer sho...

5 years ago | 0

| accepted

Load more