Answered
Getting just the time in Date-time cell
I would turn the text representation of the dates and times into a datetime array then call the timeofday function on that array...

3 years ago | 0

Answered
Character string error only in no desktop mode
Do the commands appear to have extra line breaks inserted into them? If so see this Answers post.

3 years ago | 0

Answered
A function that creates a transformation matrix
function A = to_MNI(values) Your function accepts 1 input argument. You're calling it with 14. That's not going to work. value...

3 years ago | 0

Answered
How do I write this c++ for loop statement in Matlab for loop?
You could write this as a while loop (though I'd advise you to change the variable names min and max as they already have meanin...

3 years ago | 1

Answered
When I can get matlab official Matlab for apple silicon native version or beta?
As stated on this page "An updated beta based on MATLAB R2022b will be released in the coming weeks." Please also see this Answ...

3 years ago | 0

| accepted

Answered
I can't find optimize task in live editor
According to its documentation page the Optimize task was "Introduced in R2020b". You will need to upgrade to release R2020b or ...

3 years ago | 0

Answered
2 Questions about user defined function
1.When using user_defined_function, do I have to put an 'end' at the end of code? In a function file, either all of the functio...

3 years ago | 0

Answered
My Foor loop is not working! Urgent Help please
Look at the vector over which you're iterating. 75:10:80 Your for loop only runs one iteration. Were you expecting it to run m...

3 years ago | 0

Answered
Need help debugging code
Look at how you call your function in your Command Window and look how the example calls it in the sample output. You're not cal...

3 years ago | 0

Answered
datetime() does not return time data
In the Preferences, expand the MATLAB item in the tree. Select the Command Window item. What does it list for the default dateti...

3 years ago | 0

| accepted

Answered
How to convert datetime to datestr including day of year
Looking at the table of format identifiers in the description of the Format property of datetime objects on the datetime documen...

3 years ago | 0

| accepted

Answered
Questions about infinity in matlab
In matlab it seems that as long as a number is greater than 1e309 it will be considered inf, Not just in MATLAB. This is standa...

3 years ago | 2

Answered
will lasFileWriter become available for Compiler in the future?
In general we do not comment on future plans. If you would like MathWorks to add support for lasFileWriter in MATLAB Compiler in...

3 years ago | 0

| accepted

Answered
convert Matlab results to Latex
You could publish your code.

3 years ago | 0

Answered
cant find model linearization under apps, even although control system toolbox is downloaded
Are you talking about this App that is part of Simulink Control Design? Check the output of ver to determine if you have this pr...

3 years ago | 0

| accepted

Answered
repeat each entry of a vector 100 times
Use the repelem function.

3 years ago | 0

Answered
Calling function in fminsearch
If you mean you want to call fminsearch repeatedly with different initial points, call it in a loop. f = @sin; initialPoints =...

3 years ago | 0

| accepted

Answered
How to calculate daily mean from hourly data
If you have your data stored in a timetable array I recommend using the retime function to change the time basis of your data fr...

3 years ago | 0

Answered
Increase size of workspace for real-time simulation
Check the Model Configuration parameters for your model, specifically the Additional Parameters under Data Import and Export. Do...

3 years ago | 0

Answered
I keep getting "Array indices must be positive integers or logical values". error
There is no element 0 in an array in MATLAB. The first element is element number 1. You will need to change the line of code tha...

3 years ago | 0

Answered
matlab seems to be inserting line feeds in my typed commands.
Are you running MATLAB with the -nodesktop option on Windows? Are you using either the un-updated release R2022a or Update 1 or ...

3 years ago | 1

Answered
Why is my toolbox on path when I open Matlab but not in the default path after restoredefaultpath ?
What can I do when packaging the toolbox so that it is forced in the default path ? I don't believe you can. restoredefaultpat...

3 years ago | 0

| accepted

Answered
MATLAB Arrays have incompatible sizes for this operation
Ts = 0.001; fs= 1/Ts ;% Resolution of simulation To = 0.5; % period of a QAM symbol t = 0:Ts:To-Ts; N = length(t); ...

3 years ago | 0

Answered
how do I count the upper and lowercase letters in a string
I'd probably just use isstrprop, but another possibility: s = 'Abracadabra, Hocus Pocus!'; uppercaseLettersAndNonletters = s =...

3 years ago | 0

Answered
Want to buy toolboxes for an older version of Matlab without renewing the license
Please contact the Sales department directly using this link for an answer to this pricing / licensing question. [SL: Updated i...

3 years ago | 1

Answered
How to create a tree diagram with indexes which are related to each other in a matrix?
Turn your connection matrix into a graph object then use shortestpath or allpaths on that graph.

3 years ago | 0

| accepted

Answered
compact way to plot "duration" elements, with different colors
a = duration({ ... '00:01:10' '00:01:35' '00:01:09' '00:04:40' '01:32:36' '00:01:16' '00:01:38' ...

3 years ago | 0

| accepted

Answered
for loop, in irregular numbers clusters?
v = [1 2 3 4 6 7 8 10 12 13 14 15 16 18 19 20]; for k = v disp("Now serving order #" + k) end

3 years ago | 0

Answered
Not enough input arguments for my ode15s solver
Your code attempts to call your prime function with 1 output and 0 inputs and use whatever it returns as the first input to ode1...

3 years ago | 0

| accepted

Answered
Find the minimum sum of errors for every permutation
Take a look at the matchpairs function.

3 years ago | 0

| accepted

Load more