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

5 years 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...

5 years ago | 0

| accepted

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

5 years 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...

5 years 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.

5 years 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 ...

5 years ago | 1

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

5 years 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...

5 years ago | 1

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

5 years 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)*...

5 years ago | 0

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

5 years 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...

5 years 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....

5 years 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))...

5 years 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 ...

5 years 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...

5 years 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...

5 years 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...

5 years ago | 0

Answered
MATLAB matrix using in function
Use element-wise division for the operations that will operate on the vector a_ef. deltap=-7.55*(M^2/R^2)*(1./(0.116+log(R./2.4...

5 years ago | 0

Answered
Audio Toolbox : Illegal use of reserved keyword "classdef"
To use a class file you don't run the classdef file directly. You construct the object by calling the constructor (the function ...

6 years ago | 0

Answered
Illegal use of reserved keyword "classdef" ; How to fix it?
If you're trying to run this by copying and pasting the code into the Command Window, that won't work. You need to construct the...

6 years ago | 2

Answered
two outputs of a function
Your function is defined to return two output arguments. Now you have to call it with two output arguments. I'm assuming you hav...

6 years ago | 0

Answered
Multiply/divided two tables
The arithmetic operators aren't defined for table or timetable arrays, in part because they often contain data for which those a...

6 years ago | 0

| accepted

Answered
How to unit test several different functions that take the same input arguments efficiently?
%% Test Class Definition classdef ComputeFunction1Test < matlab.unittest.TestCase %% Test Method Block methods (Tes...

6 years ago | 1

Answered
Unit test can't see the function it needs to test
+computeFunctions and +utilityFunctions are automatically in the Matlab's search path Not true. In fact, package directories c...

6 years ago | 0

| accepted

Answered
Function Has Been Partially Removed
Replace your use of fints objects with timetable as recommended in the Release Notes.

6 years ago | 0

| accepted

Answered
Error using matlab.internal.graph.MLGraph.edgesConstrWithIndex Source must be a numeric array of positive integer node indices.
The identifier graph already has a meaning in MATLAB. If possible I recommend naming your function and your function file someth...

6 years ago | 0

| accepted

Answered
How to properly display microsecond time differences
Change the Format for the datetime and duration arrays you create. t = {'2020-11-07 21:58:29.468130' '2020-11-07 21:58:29.4826...

6 years ago | 0

| accepted

Answered
I have a problem getting access to a MatLab example
Was it this example? That is in the documentation for Powertrain Blockset so you likely will need to have that product installe...

6 years ago | 0

Answered
Error in showing size of a matrix
You've defined a variable named size that's taking precedence over the built-in size function. Clear that variable (storing its ...

6 years ago | 0

| accepted

Load more