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

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

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

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

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

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

4 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); ...

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

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

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

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

4 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

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

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

Answered
The Power Electronics Simulation Onramp is missing from the Simulink Start Page.
According to the documentation page this Onramp was introduced in release R2022b. This Answers post is tagged with release R2022...

4 years ago | 0

| accepted

Answered
Assign a line in every element of a 3d matrix
If we look at the array you posted, what I think you want would involve the first row of page 1 of val having 10 elements and ro...

4 years ago | 0

Answered
From User Input to File Name
With the clarification in your comment on the answer from @Enrico Gambini, I would use string operations along with the fullfile...

4 years ago | 0

| accepted

Answered
What is the essential difference between matlab's new built-in data type dictionary and the old containers.Map?
The Release Notes state as one benefit "In almost all use cases, dictionary performs faster than containers.Map." You may als...

4 years ago | 0

| accepted

Answered
How to insert a string to a variable name
Should you try to create variables with dynamic names like this? The general consensus is no. That Answers post explains why thi...

4 years ago | 0

Answered
Reading a Graph Object from a Text File
For each line of the text file, use addedge to add an edge between the first state whose abbreviation appears on the line and ea...

4 years ago | 2

| accepted

Answered
Forgot pin for MATLAB R2022b installation
Are you using your company or school's license or are you using a license you purchased yourself? If the former, check with your...

4 years ago | 0

Answered
GUIDE handles not created automatically
When opening the .fig file directly, the layout is correct, but whenever I try to interact with it, I get that dot indexing erro...

4 years ago | 1

Answered
Hi! How can I create a conditional statement from checking if an array is empty? I will paste my non-working code here.
You don't actually have to convert the logical value into double and compare it to 1. From the documentation for the if keyword:...

4 years ago | 1

Answered
An error on Matlab 6.1
Your version of MATLAB is very old (it's over 21 years old!) and predates the introduction of anonymous functions. Anonymous fun...

4 years ago | 1

Answered
What exactly is vectorization doing
When you go grocery shopping do you go from your house to the store, pick up one item, go from the store to your house, and repe...

4 years ago | 0

| accepted

Answered
Application Compiler not Including Toolbox Functions
Without seeing how you're trying to call prctile in your app it's going to be difficult or impossible to give a definitive answe...

4 years ago | 0

Answered
sinc function doesnt work...
The sinc function is part of Signal Processing Toolbox. Check the output of the ver function to see if you have this toolbox ins...

4 years ago | 0

| accepted

Answered
I got the results I was looking for, but I believe there is an easier way to define the changing variable z which I am not sure of. Could you assist in any easier method?
Can you dynamically create variables with numbered names like z1, z2, z3, etc.? Yes. Should you do this? The general consensus ...

4 years ago | 0

Answered
Matlab display images oriented by 180.
Is the image rotated by 180 degrees, or is it flipped top to bottom? The imshow function calls image which states (in part) in t...

4 years ago | 0

Answered
Passing parameters to ODE solver event functions
The options listed on this documentation page, which are basically the same as the ones on the question to which you linked, are...

4 years ago | 0

Load more