Answered
Help with intervals (new to MATLAB)
When in doubt about a compound statement (made up of multiple pieces) in MATLAB take it one piece at a time. c = c(a<= c & c<=b...

6 years ago | 0

| accepted

Answered
Error in fminsearch (line 200) fv(:,1) = funfcn(x,varargin{:});
From the documentation page for fminsearch: "f(x) is a function that returns a scalar, and x is a vector or a matrix." Your fun...

6 years ago | 0

| accepted

Answered
Error in the function
clear; clc; Get rid of these. As written your file is a script file with local functions, and the only code that is executed w...

6 years ago | 0

| accepted

Answered
Large number of plots
Rather than opening ~150 figure windows simultaneously, why not publish the document so you only need to have one figure open at...

6 years ago | 0

Answered
How to discard entries from a matrix
See this documentation page.

6 years ago | 1

| accepted

Answered
solving a differential equation with ODE45
Remove the space in the middle of each of the last two lines of the xdot matrix. You probably also want to end the definition of...

6 years ago | 0

| accepted

Answered
How can i deactivated my Mathswork account ?
See this Answer for information on how to edit your MathWorks account. If you are unable to edit your account, please contact Cu...

6 years ago | 0

Answered
Using ismember with cell arays, R2010
What key detail have I missed? The fact that your raw cell array contains both text and numbers. groceries = {'apple', 'banana...

6 years ago | 0

| accepted

Answered
Perpetual and Annual Licenses
Please contact the Sales department directly and describe your needs. They should be able to offer guidance on the licensing sol...

6 years ago | 0

Answered
rounding string to certain decimal places
When you include %d in your format specifier for sprintf you're telling sprintf that it should expect an integer value in that p...

6 years ago | 0

| accepted

Answered
counting elements in multiple variables, in a for loop
Can you define variables with numbered names like M1, M2, M3, ... ? Yes. Should you do this? Generally we recommend against it....

6 years ago | 0

Answered
return doesn't work within function
Why does return doesn't cancel the running script? It does exit from the currently running function. It exits the scriptFailed ...

6 years ago | 1

Answered
curious behavior of geomean
According to the Release Notes the ability to specify 'omitnan' to omit NaN values from the geometric mean calculations in geome...

6 years ago | 1

Answered
colon operator in compiled python package
The variable fRange is a cell array. The colon operator doesn't know how to work on cell arrays. a = {1}; b = {10}; x = a:b %...

6 years ago | 0

Answered
datevec back to regular time
I second Walter Roberson's suggestion to skip the datevec form and to use duration. t = '1:31:00' du = duration(t) newtime = ...

6 years ago | 0

Answered
How do I find the mean and standard deviation of each column for this data?
If you've read this data into a table array you can extract those variables in the table that contain numeric data then use varf...

6 years ago | 0

Answered
How I can determined the number of digits in decimal number ?
According to the Compatibility Considerations section on the documentation page for the round function the ability to specify a ...

6 years ago | 1

Answered
How to draw an Arc in the direction you want? (with known radius, centre and angle)
Use an ending angle of 360 degrees rather than an angle of 0 degrees. You can skip the deg2rad calls by using the degree-based t...

6 years ago | 1

Answered
why i cant get a reset password at my email?
Have you checked your spam folder in case the password reset message was accidentally classified as spam? If it is not in your ...

6 years ago | 0

Answered
Fixed-Point Designer toolbox doesn't exist.
You should probably check with your license administrator to confirm that 1) Fixed-Point Designer is included in your license an...

6 years ago | 0

Answered
Save classdef with Object in MAT file
Typically I process all my data into one MAT file with each variable names something like "Thermocouple_01", with all the necess...

6 years ago | 0

Answered
Paying by Postal order for matlab
Please contact Customer Service in the UK office. They should be able to answer your question and give you the location where yo...

6 years ago | 0

Answered
How to get ride of duplicate rows?
Use unique with the 'rows' option or uniquetol with the 'ByRows', true name-value pair.

6 years ago | 0

| accepted

Answered
why am I getting this error?
[t,x]=ode45(odefun,tspan,IC); This attempts to call your odefun function with 0 input arguments and use the function handle it ...

6 years ago | 0

| accepted

Answered
Why option for fmincon is not working ?
If you want to provide an options structure to fmincon you must provide all the input arguments that precede it. While you've pa...

6 years ago | 1

Answered
I can't get the value associated with the maximum frequency from the "histcounts" function.
If you want the element of magS whose corresponding element of magcount is the maximum in that vector, you need to use the secon...

6 years ago | 0

| accepted

Answered
Convert time column from hours to ddmmmyyyy HH:MM:SS
dth = 999312 + [0;1;12;24;36;42] % fake data start = datetime(1900, 1, 1); dates = start + hours(dth)

6 years ago | 2

Answered
Problems with sin, cos, tan and cot
If you're computing sin, cos, etc. of either angles in degrees or angles that a multiple of pi radians there are other ways to c...

6 years ago | 0

Answered
can anyone please explain X0(1:2) where X0=[0,0,0]' , i wrote X0(2:2) and gave answer 0 i tht it shoudl give error . what i understand is X0(1:2) is 1 row 2 element. please correct me
v = 2:2 is the vector formed by starting at 2 and going to 2 by steps of 1. That vector is equivalent to writing v = [2] or v = ...

6 years ago | 0

Answered
When opening R2020b .mlapp file in R2018b, automatic conversion removes all UI elements and associated auto-generated code
I suspect it's going to be difficult to determine exactly why the components have been removed from the app without seeing the a...

6 years ago | 0

Load more