Answered
How to add calculated parameters in to plot title
Try this: title(sprintf('x\\_variable: \\mu = %.2f, max = %.2f, \\sigma = %.2f', mean_ab, max_ab, std_ab)) Experiment to get ...

7 years ago | 1

| accepted

Answered
Accidentally overrode 'filter' function, how can I get it back?
It’s probably still there. first run this line from a script or your Command Window: which filter -all When I ran it, I go...

7 years ago | 0

Answered
Drawing 3d objects and filling the sides
If you simply want different numbers of sides of a regular polygonal solid, this works: N = 3; ...

7 years ago | 9

Answered
how to select from identical rows based on their associated value in one column?
Another approach using accumarray: a = [1 , 0.6 2 , 0.9 1, 0.4 3 , 0.5 4 , 0.2 2 , 0.1 4...

7 years ago | 0

| accepted

Answered
Differentiation help with polynomial
Since ‘y’ and ‘yest’ have the same number of elements, I would just subtract them (assuming they are with respect to the same (‘...

7 years ago | 0

Answered
Finding Min and Max of a sinusoidal function
I note that you’re using the code change I suggested, even though you did not Accept my previous Answer. If you have R2017a o...

7 years ago | 1

| accepted

Answered
Matlab 2019a projects
It’s there, as one of the options in the ‘New’ radio button dropdown menu:

7 years ago | 0

| accepted

Answered
"Index exceeds the number of array elements (1)" error
It appears that you intend ‘lnx’ to be a function. Try this: lnx = @(n) ((((-1)^(n+1))/n)*((x-1)^n)); then see the documen...

7 years ago | 0

Answered
Plotting Transmission Loss with for loop
The ‘f’ variable will be the scalar last value at the end of the loop. What you likely intended was: s1 = 0.05; s2 = 0.15; ...

7 years ago | 0

| accepted

Answered
Finding the infinity norm of a cell array
I’m not sure what you want to do. Try this: mats = {rand(4), rand(5), rand(3)}; mu_mats = cellfun(@(x)norm(x,Inf), mats); ...

7 years ago | 1

Answered
Is the toolbox installed or not?
You can always try something like this for the Signal Processing Toolbox: figure freqs([1 0 100], [1 1]) That should plot a ...

7 years ago | 0

| accepted

Answered
Array reverting to 0 when called
Providing that none of your ‘xa’ values are negative or zero, use semilogy instead of plot.

7 years ago | 0

Answered
Having troubles getting a rect function ussing fft and the sinc function
You are not plotting your Fourier transform correctly. Try this: x = linspace(-10, 10, 10000); y = sinc(x); Fs = 1/mean...

7 years ago | 2

Answered
Why am I not able to use decimal numbers in my code? (Index in position 1 is invalid. Array indices must be positive integers or logical values)
This is the assignment that throws the error: rho(0.05,0.025)=0; % charge at the center of the box Note that 0.05 and 0.025 a...

7 years ago | 0

Answered
fit a curve and equation
Since you know ‘b’, your system is linear. This works: x = [x1 x2]; y = [y1 y2]; B = [x(:).^(-0.5) ones(2,1)] \ y(:); ...

7 years ago | 0

| accepted

Answered
"Subscript indices must either be real positive integers or logicals"
Your index may be postive, however since ‘q’ is not a function, MATLAB interprets the ‘q(x)’ in this assignment: a(1) = 2 + (h...

7 years ago | 0

Answered
How to use Nonlinear Data-Fitting to fit to an analytical solution.
You need to create an anonymous function (see the documentation on Anonymous Functions (link)) from your symbolic derivation to ...

7 years ago | 1

| accepted

Answered
Add to a cell array in a for loop
Your ‘indx’ assignment is not coded correctly. See the documentation section on Apply Multiple Conditions (link). This may w...

7 years ago | 0

Answered
How to change Semilogy axis
I’m guessing here. Try this: x = 2 + sort(rand(1, 8))*2; y = 2.2 + sort(rand(1, 8), 'descend')*1.5; figure semilogy(x,...

7 years ago | 0

Answered
How do I save a colormap and use it for another figure?
After you plot the first figure, use this get call: cm = get(gca,'Colormap'); Note that the 'Colormap' (link) and the colorba...

7 years ago | 3

| accepted

Answered
Index exceeds the number of array elements (1).
Your random calls are returning only one value because that is all you requested from them. If you want an array of values, you...

7 years ago | 0

| accepted

Answered
plot symbolic function real part
You are plotting a function of two variables, so you need to use a plot that accommodates them, and that your function is symbol...

7 years ago | 1

| accepted

Answered
how to use a vector as an input in a function
See the documentation on Function Basics (link). Your code has a number of errors. This corrected version works: functio...

7 years ago | 4

| accepted

Answered
Plotting Images on a Subplot from a Loop
Rename your ‘subplot.m’ function to something else, for example: C:\Users\Lizzy\Documents\Year 3\EG-353 Research Project\Embry...

7 years ago | 0

| accepted

Answered
Upload signal data (amplitude data, and time in millisecond) to Signal Analyser app
I can get it to work with a (Nx2) matrix with the time values in the first column and the signal values in the second column. (...

7 years ago | 0

| accepted

Answered
Plots for unevenly distributed data
You cannot get them from the plot, although you can calculate them. To create a regularly-spaced time vector, used the linspa...

7 years ago | 0

| accepted

Answered
How to plot a transfer function with variable input?
I am not certain exactly what you are asking, or what your system is doing. You need to use the tf (link) function to produce a...

7 years ago | 2

Answered
Tabulated Value for g
The [G] value appears to be the third value (row) in the ‘f’ vector, and so is the third column in ‘y’. To plot it, try this:...

7 years ago | 0

| accepted

Answered
How do I generate a random number with normal distribution
This is called a truncated distribution. While you are correct that it is no longer strictly a normal distribution (that extend...

7 years ago | 1

| accepted

Answered
how can i separate strings in cell like {'3m','cm'} to number 3, char m and string cm?
Experimenmt with the regexp (link) function: c = {'3m','cm'}; r = regexp(c, '\d*|\w*', 'match'); r1 = r{1} r2 = r{2} produ...

7 years ago | 2

| accepted

Load more