Answered
Creating a Matrix of random numbers
possibleValues = [-1, 1]; desiredSize = [5 6]; A = possibleValues(randi(numel(possibleValues), desiredSize)) This assumes you...

9 jours ago | 2

| accepted

Answered
My polyfit function is displaying NaN
There are at least three potential difficulties with your code. The first difficulty is that you're passing log10 of the Displac...

9 jours ago | 0

Answered
Draw a heptagone of dice vertices. MATLAB.
polyshape, patch, or plot are three possibilities depending on what you want to do later on with the polygon.

9 jours ago | 0

Answered
How do I throw an error from TimerFcn?
The TimerFcn is running at the same time as MATLAB is executing the try / catch block but it's not executing "inside" the try / ...

9 jours ago | 0

Answered
I'm keep having an error 'Not enough input arguments' for this code
Others have commented on the fact that you need to call your function with an input argument. I want to point out a different pr...

9 jours ago | 0

Answered
discrepancy in date conversion
See the description of the dateType input that you can pass into datetime on the documentation page for datetime, specifically t...

10 jours ago | 0

Answered
create multiple separate vectors from a For loop
Rather than creating several different variables with numbered names or even a cell array, I'd prefer to create an array. nside...

10 jours ago | 0

Answered
How to change exponentiation
Change the display format. format % default which is "format short" e = [5.45894e-6, -1.875e-5, 6.25e-6; ... -1.875e-5, 1...

10 jours ago | 0

Answered
I can't get millisecond accuracy from string based timestamp - not sure what I'm doing wrong
If you don't have date information associated with your timestamps, I would use duration instead of datetime. S = ["11:00:00.14...

10 jours ago | 0

Answered
why do I have unrecognized function error for z?
What should the value of z be if buff is none of "none", "30min", or "60min"? What if buff was "30 minutes", for example?

10 jours ago | 0

Answered
Cannot call INPUT from EVALC
You cannot call input from within evalc. I believe this is the expected behavior. evalc would prevent the prompt text from input...

11 jours ago | 0

Answered
How to disable the TAB to get into an EditField box (R2020b)?
Try setting its Enable property to 'on' and its Editable property to 'off'. See the pictures in the description of the Editable ...

11 jours ago | 0

Answered
Converting UTC time to seconds
s = '12:34:56.789'; formatSpec = 'hh:mm:ss.SSS'; d = duration(s, 'InputFormat', formatSpec, 'Format', formatSpec)

11 jours ago | 1

| accepted

Answered
Local Function not being Entered
You define the local function RPM1 in your script file, but you never call RMP1 inside your script file. MATLAB does not automat...

11 jours ago | 0

| accepted

Answered
Keep strings seperated in array
s = struct('abc', {'def', 'ghi', 'jkl'}) charVec = [s.abc] cellVec = {s.abc}

11 jours ago | 0

Answered
Area of Circle syntax error
If that's the actual code your teacher gave you, they played a bit of a trick on you. [I assume the missing ' before s was a cop...

11 jours ago | 0

Answered
How can i convert Matlab code to hdl code
See HDL Coder. Not all functions have the capability to have HDL code generated for them. See this list for functions that do.

11 jours ago | 0

| accepted

Answered
How to fix my code for ode45
I'm guessing you've defined a variable named ode45 that's preventing you from calling the ode45 function included in MATLAB. To ...

11 jours ago | 0

Answered
Is there a way to use symbolic functions in ode45
You could make your function accept additional parameters. Then you could specify a function handle as that additional parameter...

12 jours ago | 1

Answered
Is it possible to rename a group of values based on the previous values in a table
So you want to change the category values for the image variable in your table? Easiest would probably be to use renamecats. we...

12 jours ago | 0

Answered
logic used in matlab
When you see a line of MATLAB code you don't understand, try breaking it into pieces. If you don't understand the pieces, break ...

12 jours ago | 0

| accepted

Answered
Parse error at EDD
Let's look at one section of the snippet of code you posted. for m = 1:L_Z for n = 1:L_Pe H = (Pe(n)*...

12 jours ago | 0

Answered
How to model custom shapes?
The alphaShape and polyshape functions may be of interest to you.

12 jours ago | 0

Answered
Simulink version 5.0 download
Looking at the release history in the PDF User's Guide, Simulink 5.0 was part of release R14 (not release R2014a or R2014b) whic...

12 jours ago | 0

Answered
Trouble creating function handle with matrices in matlab
mdlfunc = @(b,x1) -R_const*T(x1.* log(x1 + b(1).* x2) + x2.* log(x2 + b(2).* x1)); You meant to multiply T by the quantity (x1....

12 jours ago | 1

| accepted

Answered
Plotting mean across a graph
If I understand what you want to do correctly, use the yline function. x = datetime('today') + days(0:9); y = 10*rand(size(x))...

13 jours ago | 0

Answered
selectLabelsByName not working on MATLAB 2020B
According to the Support site's documentation search it appears there are two functions by that name. Because of the categories ...

13 jours ago | 0

Answered
Error: File: testem.m Line: 87 Column: 5 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
If you're going to put the end keyword (or the elseif keyword that's part of an if statement) on the same line as another statem...

13 jours ago | 0

Answered
How to call data from files named with dynamic index
%{ % for each of these text files, plot a set column as x and another as y figure hold on % k is a high number and the numbe...

13 jours ago | 0

Answered
Defining multiple variables in a single loop
You are, of course, using a loop. I suspect what your supervisor told you (or intended to tell you) is that you don't need to us...

13 jours ago | 0

Load more