Answered
How to solve ODE's in Matrix Form?
For a linear system such as yours, another option is the expm (link) function. It is the term in the solution for a linear sys...

8 years ago | 0

Answered
Peak alignment from matrix of curves
See if the alignsignals (link) function will provide the result you need. Choose one signal and align the rest of them to it. ...

8 years ago | 0

| accepted

Answered
Access every nth occurrence of a value in a matrix
One approach: Atv = reshape(A', [], 1); % Transpose & Reshape To Column Vector lidx = find(Atv); ...

8 years ago | 0

| accepted

Answered
Integrating under a curve between known points
‘But I have no clue how to integrate between X coordinates of 0.533 and 1.818. And Y coordinates of 0 and 958.2’ Without your d...

8 years ago | 0

Answered
Regarding Loops and Control theory .
If you want to use ‘s’ in a control system definition, define it as: s = tf('s'); then you can use it to define your transfer...

8 years ago | 1

| accepted

Answered
How to find closest Lat/Lon on a grid to an existing Lat/Lon
Two possibilities come to mind, one being knnsearch (link), and the other being pdist2 (link).

8 years ago | 0

Answered
How to isolate peaks from a noisy power spectrum
The findpeaks (link) function comes quickly to mind. Also, the islocalmax (link) function, introduced in R2017b.

8 years ago | 0

Answered
Index in position 2 exceeds array bounds (must not exceed 1).
You have assigned ‘A’ as a scalar. Preallocating is a good idea, however this would likely be more effective: A = ones(1,24);...

8 years ago | 0

| accepted

Answered
Plot integral with fplot
Using str2func is not the correct approach for dealing with symbolic expressions, and especially those that involve symbolic fun...

8 years ago | 0

| accepted

Answered
Problem with Linear Regression
A first-degree polynomial is a linear fit. You do not need any toolboxes to do a linear fit. Try this: knobSetting = [0 1 ...

8 years ago | 0

Answered
Using loops to find cumulative data
You’re off to a good start. You need to use the unique function and the accumarray function to get the result you want. The on...

8 years ago | 0

| accepted

Answered
Intersection Points of Two Curves
‘why its showing error when i want to get the coordinate of the intersection points of the two curves’ Probably because you d...

8 years ago | 0

| accepted

Answered
How to do manipulation of derivatives for symbolic variables using the symbolic toolbox?
I cannot follow what you apparently want to do with your code. See the documentation on the symbolic diff (link) function. R...

8 years ago | 0

Answered
Error: Unbalanced or unexpected parenthesis or bracket.
Use parentheses to define the function call: [fobj, fsomething]=Something([1 2 3 4 5 6 7 8 9 10 11 12 ]);

8 years ago | 0

| accepted

Answered
How to change width of quiver plot instead of length=
You can turn off the scaling (from the documentation): quiver(...,scale) automatically scales the arrows to fit within the gri...

8 years ago | 0

Answered
Drawing this shape using *
This takes me back to my FORTRAN days in the late 1960s when line printer code similar to this was the only option for plotting....

8 years ago | 0

| accepted

Answered
Why is my graph coming out blank when i try and plot this code?
Because you are calculating a single point. If you use element-wise division here (using ./ rather than /), you get the plot ...

8 years ago | 0

Answered
error occurs in the present code
You have a typographical error in your odeset call. You typed ‘l’ (lower-case ‘L’) instead of the number 1. Use this instead...

8 years ago | 0

| accepted

Answered
Line function overwriting previous lines
This works for me: L = 42; W = 42; dz = 13; a = pi; figure line([0 L], [W/2 W/2]); % Horizo...

8 years ago | 1

| accepted

Answered
random gaussian noise with zero mean and unity variance
You are probably missing a multiplication (or other) operator. Try this: kk1 = kk1.*(1+(0.1).*array_gaussian_noise);

8 years ago | 0

| accepted

Answered
how to reduce rows to column
Use the reshape (link) function.

8 years ago | 0

| accepted

Answered
Comparing 2 columns of a matrix
Try this (using the accumarray (link) function): A = [randi(10, 20, 1) rand(20,1)] % Create Data...

8 years ago | 0

| accepted

Answered
shift sine wave by 90 degree
Take the derivative of it.

8 years ago | 1

Answered
Plot a Cube centered at the origin
This should get you started: a = -pi : pi/2 : pi; % Define Corners ph = pi/4; ...

8 years ago | 5

Answered
Adding a column to a datafile
Try this: datafile = [3750 555 10266 3750 555 0 3750 555 0 3750 555 0 3750...

8 years ago | 0

Answered
Undefined function or variable 'fixedWidthImportOptions'.
It’s an options structure to be used with the readtable (link) function. See the documentation section on Examples (link). H...

8 years ago | 0

Answered
how to generate a matrix with 2 columns and changeable number of rows
use the meshgrid (link) function (or optionally ndgrid (link)): step = 0.4; v = 0 :step : 3*step; [X,Y] = meshgrid(v); OutM...

8 years ago | 0

| accepted

Answered
How do I create a local function using a string?
‘I am attempting to create a local function from a string.’ Since you are starting from a string, use the str2func (link) funct...

8 years ago | 0

Answered
Making Different Length Vector Same Length
One approach: strainNew = interp1((1:numel(strain)), strain, linspace(1, numel(strain), numel(stress)), 'linear')'; figure ...

8 years ago | 2

| accepted

Answered
How to increment from 1 to 0.0000000001 (9 zeros) in 11 rows, 1 column (divide by 10 each time)
Use the logspace (link) function: v = logspace(0, -9, 10)' to get: v = 1.000000000000000 0.100000000000000 0.01...

8 years ago | 2

Load more