Answered
Assign a row vector to a row of an array using logical indexing to omit certain values
In many places in MATLAB, the values 0 and false can be used interchangeably. x1 = 5+0 x2 = 5+false Indexing is one of the ex...

3 years ago | 0

Answered
comparision of data with logic given as input
Can you dynamically create and operate on variables with numbered names like T1, T2, T3, etc.? Yes. Should you do this? The gen...

3 years ago | 0

Answered
I keep getting a "convenc" error. Line 88. Could be "varargin" missing argument? Not sure.
If you're calling the convenc function from Communications Toolbox, the section of that documentation page that describes the ms...

3 years ago | 0

Answered
How to access external variables in other workspace? (fmincon function)
Don't use global variables. Parameterize your nonlinear constraint function instead. If you define your constraint function as: ...

3 years ago | 0

Answered
Trend lines with moving average
My first thought would be to try using the Remove Trends Live Editor Task or the trenddecomp function.

3 years ago | 0

Answered
How can I randomly excuted for loops inside MAIN FOR LOOP instead of run them in ordered ?
Another possible solution to the problem, if you want to run a series of functions in a loop in a random order, is to use a cell...

3 years ago | 1

Answered
Can I call index of max function out and before the function ?
There's another problem with your code above and beyond what Walter described. If you want to call the max function inside your ...

3 years ago | 0

Answered
Find logical and (&&) for string array
That should work as long as the string arrays you're using in your comparisons are scalars. arrayX = "Left"; arrayY = "Right";...

3 years ago | 2

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values?
If you just want to be able to determine the mass for a specified identifier, I wouldn't use ismember in this case. I'd use a di...

3 years ago | 0

Answered
What is the answer of [(4 -2 ) /2 , 5 +6 , 7 , 8 ] ? Why does MATLAB output [1 5 6 7 8]?
See this documentation page for more information.

3 years ago | 0

Answered
Error: Reference to non-existent field 'A'. Changed between 2018 to 2022 versions?
Why is the specific text of the error message important for your application? If we had a typo in an error message and we corre...

3 years ago | 2

Answered
How to bubble sort incorporating deal function
There are a number of improvements I'd recommend you make to your code. close all; clear; clc; Don't use "close all; clear; cl...

3 years ago | 0

Answered
Change of properties of UI dynamic components (AppDesigner)
You don't appear to be storing the led array you created inside ApplyButtonPushed to any of the properties of your app, so it's ...

3 years ago | 0

| accepted

Answered
What is the purpose of zero function?
The zeros function is used there to preallocate the array. Rather than having to find a new block of memory to store the results...

3 years ago | 1

| accepted

Answered
invalid index in find function
There's no guarantee that the elements of x_axes (the points that you selected using ginput) are integer values. Therefore there...

3 years ago | 0

| accepted

Answered
R2022B Update4 is not offered
Please see the accepted answer on this Answers post.

3 years ago | 0

Answered
I can not receive activation key
If you are using your educational institution's or your company's license please contact the person or group that administers yo...

3 years ago | 1

Answered
how extract table RowNames based on table elements
I'd use ismissing, to avoid the need to extract the whole contents of the table into a separate array. % a table as you describ...

3 years ago | 0

Answered
Someone please help to rectify this error: Error using barrier Objective function is undefined at initial point. Fmincon cannot continue. Optimization problem
We can't run your code as we don't have all of the functions it uses, but what do you receive as an answer when you call obj_GOH...

3 years ago | 0

Answered
Run Fminsearch in a loop
Parameterize your costfunction. The "Minimize with Extra Parameters" example on the documentation page for the fminsearch functi...

3 years ago | 1

| accepted

Answered
Are there any matrix balancing/scaling function in matab for complex rectagular matrices?
I have a complex number matrix with 45 x 2 size. And it needs to be inverted. How exactly do you define inversion for a non-squ...

3 years ago | 0

Answered
Why calling the functions works fine in the first run, but causes error after that?
Don't assign the output from the function p1 to a variable named p1. If you do you will not be able to call the function while t...

3 years ago | 0

| accepted

Answered
riskfolio-lib / PyPortfolioOpt like functionality
I'm not familiar with those libraries but just based on the names I think the "Portfolio Optimization and Asset Allocation" cate...

3 years ago | 0

| accepted

Answered
How to use input string as a function in Appdesign?
If the user enters an expression in the edit field, you can convert it into an anonymous function using a couple of functions. ...

3 years ago | 2

Answered
How can I create an inherit class based on variable value?
You could create a function handle to the constructor then call that function handle. index = 2; % example fh = str2func("clas...

3 years ago | 0

| accepted

Answered
How to set contour levels
and I got the attached figure Contour1 with contour levels of 50 No, that syntax creates 50 contour levels. To specify a single...

3 years ago | 0

Answered
How do I wrap text using the disp or display function?
You could use the textwrap function to wrap the text manually. a = "The quick brown fox jumped over the lazy dog"; b = textwra...

3 years ago | 0

Answered
why do I receive not enough input arguments
Based on the function definition: function [y] = signal_avg_lim( filename, peaknumber, revsize ) your function can accept a ma...

3 years ago | 0

Answered
ind2sub with arbitrary martix
You have to specify the size of the array you want to use the subscripts to index into because the same linear index could gener...

3 years ago | 0

Answered
how to refrech XticksLabel when i zoom a graph in an app
Rather than calling datestr or datetick I recommend plotting using a datetime array as your X data. v = 0:10; y = v.^2; tenDa...

3 years ago | 0

| accepted

Load more