Answered
ode45 with vector of inputs using symbolic toolbox
The Symbolic Math Toolbox is not the best approach to this straightforward linear control problem. If you do not want to use th...

7 years ago | 1

| accepted

Answered
Multi line color in graph
Try this: cmap = colormap(gray(10)); figure hp = plot(1:10, rand(10)); set(gca,'ColorOrder',cmap) Experiment to get duffer...

7 years ago | 1

| accepted

Answered
How can I truncate a random generated exponentail distribution?
Use the truncate function (introduced in R2013a). See the documentation section on pd to use it with different distributions....

7 years ago | 0

Answered
How do i plot a function that is dependent of itself
You posted a differential equation, so in order to solve for ‘h’ you need to integrate it. It does not likely have an analytic,...

7 years ago | 2

| accepted

Answered
Plotting a p-V diagram
I’ve not considered this since senior Thermodynamics (back in the phlogiston era). This should get you started: Tv1 = linsp...

7 years ago | 2

| accepted

Answered
How can i plot an inline function?
Use Anonymous Functions instead of inline objects, since inline objects are likely to be depricated soon. There is a missing ...

7 years ago | 0

Answered
what does ~ do in this code?
The tilde ~ tells rref not to return the first output. See: MATLAB Operators and Special Characters for details on it and oth...

7 years ago | 1

Answered
How to rotate 3d graph freely by x or y axis?
It is not interactive, however the rotate function should do what you want.

7 years ago | 0

Answered
Why array of strings are concatenated?
The square brackets [] are a concatenation operator. To keep the individual strings as strings, use a cell array: parameter...

7 years ago | 2

| accepted

Answered
getting error in contour plot
Try this: nx = 50; ny = 50; z = psi((1:ny)'*(1:nx)); X = linspace(0,1, size(z,2)); Y = linspace(0,1,size(z,1)); ...

7 years ago | 0

Answered
Problem solving laser rate equations with ode45 command
Change the function declaration line of your differential equation system function to: function ydot = rate_eq_fano_program_1(...

7 years ago | 1

| accepted

Answered
Array indices must be positive integers or logical values.
I suspect this is the problem: p(i,0)=y(x(i)); Subscript references in MATLAB must start at 1. Note that positive integers a...

7 years ago | 0

Answered
How do I integrate a combined function?
Since ‘a’ is a function of ‘x’, call it as a function. Try this: a = @(x) x; b = @(x) a(x).*cos(x); C = integral(b,0,5) ...

7 years ago | 1

| accepted

Answered
How can I find cross axis from set of signal data
If you want to find the peaks in your data (that looks like a photoplethysmogram signal), use the Signal Processing Toolbox find...

7 years ago | 1

| accepted

Answered
Upload Song to MATLAB and produce signal waveform?
Use the audioread function to import it. It then becomes a numeric data file, and you can do whatever you want with it after ...

7 years ago | 0

Answered
how do I evaluate the value of an expression?
Try this: f = @(x) (x.^2) -x +1 - (exp(-x)); x1 = -1.9; fx1 = f(x1) creating an anonymous function and producing: fx1 = ...

7 years ago | 2

| accepted

Answered
Looking for a Surface - like plot
I am not certain what you want. However the heatmap (R2017a and later) function and image may be options.

7 years ago | 1

| accepted

Answered
Find the order of a Butter-worth low pass filter in Matlab
Start with the butter function and follow the links in and at the end of that documentation page. Specifically note the discu...

7 years ago | 0

| accepted

Answered
Plotting IIR filter error
You are plotting one point, so you need to plot a marker instead of a line. I am not certain what you are doing, so consider ...

7 years ago | 0

| accepted

Answered
How can I make matlab read my text document row by row and produce a nx1 matrix?
Several options: dlmread, readmatrix, others to read it. EDIT — To then produce an (Nx1) vector, use the (:) subscript con...

7 years ago | 0

Answered
is it possible to save csv files in loop with fopen..getting error Error using fopen Invalid permission.
It would be easier to use csvwrite (or writematrix) than creating you own version.

7 years ago | 0

| accepted

Answered
What to do in the case of a matrix 2x2 .......tf2ss
Note that the present problem uses the Control System Toolbox. The tf2ss function is in the Signal Processing Toolbox. To conv...

7 years ago | 0

Answered
How to colour outside part of parabola
You did not post your code, so I created an example that you can adapt: y = linspace(-2, 2, 250); xp = y.^2; xv = 2*y+2; ...

7 years ago | 0

| accepted

Answered
How Can i speed up "for" loop ?
I am not certain what you are doing or what the values of the vectors and ‘r_ell’ are. Use ndgrid and vectorisation to make thi...

7 years ago | 0

| accepted

Answered
Remove data labels in a heatmap
If you just want to remove them, try this: hmh = heatmap(a,'xlabel','\mu','ylabel','\nu','title',sprintf('Frequency of (\\mu, ...

7 years ago | 6

| accepted

Answered
Why I cannot get the result of the numerical integral
Vectorise everything! Also, create anonymous functions for ‘A’, ‘B’, and ‘S’. (There is no need to use the Symbolic MAth Toolb...

7 years ago | 0

| accepted

Answered
How can I filter the following audio file using matlab:noisy_sound_file
Read and Write Audio Files

7 years ago | 0

Answered
Why does the following Butterworth code fail to produce a bandpass filter?
What is the sampling frequency of your signal? Use it to normalise the passbands. For example: Fs = ???; Fn = Fs/2; Wp =...

7 years ago | 0

Answered
how to use Discretize syntax
Try this: Data = [randi(29, 20, 1) rand(20, 5)]; % Create Data, ID Numbers 1-29 In First Column ClassVct...

7 years ago | 0

Answered
Customize xtick in plot of timeseries
See the documentation section on: Plot Dates and Durations.

7 years ago | 0

| accepted

Load more