Answered
Warning: Function class has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict
You've created or downloaded a file named class.m that's preventing MATLAB from calling the built-in class function. Identify th...

5 years ago | 1

| accepted

Answered
Extracting value from Name-Value pairs using the Name string
test = struct('units', {'degrees_east', 'degrees_north'}, ... 'long_name', {'longitude', 'latitude'}) theNames = {test.lon...

5 years ago | 0

Answered
How do I get an Expression to Use the Value of a Variable that was Assigned after the Expression was Defined?
Use subs. syms z f = 2*z z = 4; f g = subs(f)

5 years ago | 0

| accepted

Answered
What is the equivalent of mmult of excel in matlab?
The * operator performs matrix multiplication, but in order for that operation to be mathematically defined you need to transpos...

5 years ago | 1

| accepted

Answered
Cut a graph ?
If the data to be plotted includes NaN, that point will not be plotted. x = 1:5; y = [1 2 NaN 1 2]; plot(x, y) axis([0 6 0 3...

5 years ago | 0

| accepted

Answered
Histogram occurences per age problem
Use the histogram function instead of histc.

5 years ago | 1

| accepted

Answered
How to assign strings and numbers to elements of the same matrix?
Do you need your data stored with mixed-type columns or would mixed-type rows work? If the latter, consider a table array. Resu...

5 years ago | 0

Answered
Passing additional argument into objconstr
Adapting the example from the documentation page for packfcn: ros = @(x, k) k*(x(2) - x(1)^2)^2 + (1 - x(1))^2; % Added a param...

5 years ago | 0

Answered
Use of Genetic Algorithm feature for optimization of technical design
What signature does the documentation page for the ga function state your nonlinear constraint function must have? [How many inp...

5 years ago | 2

Answered
Transpose pivot reshape a MATLAB table from a cross-section wide 'row format' to a panel-data long 'column' format
I'm not sure where those 4444 values came from in your second T variable, but I think what you want is to stack your table data....

5 years ago | 0

Answered
How to determine polynomial coeffisient of N x M matrix instead Of 1 x N or N x 1?
Do you want M polynomials, one per row, or do you want one polynomial for all your data? If the latter, just columnize your data...

5 years ago | 0

| accepted

Answered
Is there a better way to use cellfun with arguments? and is it better than for-loop?
A = {1:10, magic(5), @sin} cellfun(@(x) size(x, 1), A)

5 years ago | 1

Answered
[beginner] How do you plot two vectors of diffrent length?
I believe your suspicion about whether the commas should be periods is correct. MATLAB uses the convention that the decimal sepa...

5 years ago | 0

Answered
How do I create array of a function with for loop?
I have a in total 42 of 424x412 doubles Can you do this? Yes. Should you do this? The general consensus is no. Rather than ha...

5 years ago | 1

Answered
Setting a plot's x-axis by units and not finer data points?
When you call plot with one data input, the indices of the elements in the vector are used as the X coordinates. plot((1:10).^2...

5 years ago | 0

Answered
Use of geoglobe in MATLAB R2017a
As stated on the documentation page for the geoglobe function, it was introduced in release R2020a. It did not exist in release ...

5 years ago | 0

Answered
I am trying to solve 3 simultaneous ODE's. Which method to use?
This documentation page includes two examples, the second of which you can use as a model for your code to solve a system of dif...

5 years ago | 1

Answered
creating variables with a for loop
Can you define variables with numbered names like X1, X2, X3, ... or whose names are given by a list of strings? Yes. Should y...

5 years ago | 0

Answered
Which toolboxes are recommended for civil engineering?
This question is really quite general and so it's difficult to give a definitive answer. If you open the Solutions page linked a...

5 years ago | 0

Answered
Efficient ODE with function handles
Does f_function expect to be called with two input arguments or three? x = [1; 2; 3]; y = [4; 5; 6]; value1 = min([x, y], 4) ...

5 years ago | 0

Answered
Converting hh:mm:ss into seconds
t='14:35:59.812'; F = 'hh:mm:ss.SSS'; du = duration(t, 'InputFormat', F, 'Format', F) format longg % To make s look nicer s ...

5 years ago | 0

Answered
How to average first two dimension of 3D array/matrix?
The ability to specify a vector of dimensions over which to sum an array was introduced in release R2018b as stated in the Relea...

5 years ago | 1

Answered
function whose arguments contains a function with possibly a variable number of outputs
See this documentation page, specifically the section on How to Use Comma-Separated Lists.

5 years ago | 0

| accepted

Answered
For inbuilt solvers ODE23/DDE23, how to keep saving/output all solution values intermediately (eg: every 1 hour, save/output the solution instead of only after reaching tf)
Specify an OutputFcn in your dde23 function. Have that OutputFcn log the data to a file.

5 years ago | 0

Answered
How can I convert a time vector of HH:SS to a decimal?
If you have them stored as a duration array just use the hours function. du = duration({'03:30', '04:45'}, 'InputFormat', 'hh:m...

5 years ago | 1

| accepted

Answered
Loading mat files does not support enumerations with function handles?
The question of whether two function handles are the same is a bit complicated.

5 years ago | 1

Answered
How to compute the standard deviation of each column in a matrix?
To be certain that you're taking the std over each column, specify the dim input argument as described on the documentation page...

5 years ago | 0

Answered
All -9999 in a table to NaN
Use standardizeMissing. dblVar = [NaN;3;Inf;7;9]; cellstrVar = {'one';'three';'';'N/A';'nine'}; charVar = ['A';'C';'E';' ';'I...

5 years ago | 0

| accepted

Answered
How do I get over a MATLAB addiction?
Sometimes such an "obsession" or "addiction" can lead to a 20 year and counting career, so it's not always so bad. :)

5 years ago | 0

| accepted

Answered
Variables as arguments in 'listed' function inputs
What you've written is the command syntax. You want to use the function syntax instead. See this documentation page for more inf...

5 years ago | 1

| accepted

Load more