Answered
Why do I get "Array indices must be positive integers or logical values"?
MATLAB does not recognise implicit multiplication, so the missing multiplication operator vt=vf(1-exp(-t/tao)); ↑ ← HERE ...

5 years ago | 0

Answered
My graph won't display when I run my code. How do I get it to show?
Without seeing the ‘myFunc’ code, there is no way to provide a meaningful reply. The most likely result is that with: ICs=...

5 years ago | 0

Answered
How do I change the values ​​of the axes?
Try something like this — x = linspace(0, 21, 25); y = rand(size(x)); figure plot(x, y) xt = get(gca, 'XTick'); xtv = l...

5 years ago | 0

| accepted

Answered
Ignore NaN values in a Table
Since the Question appears to apply to the prod funciion, see the section on Product Excluding NaN. (I am not certain when that...

5 years ago | 0

Answered
How to change the values of both axes
There are ways to change the exponent display of the axis rulers using the NumericRuler Properties, however that is not necessar...

5 years ago | 0

| accepted

Answered
How do i define a variable as a function?
I suspect this works the similiarly in Maple (that I do not currently have) — syms t theta(t) f=cos(theta(t)); dfdt(t) =...

5 years ago | 0

| accepted

Answered
what do you obtain when you do the f
‘what do you obtain ?’ Run it and plot it (using the Signal Processing Toolbox rectpuls function) to see the result — t = lin...

5 years ago | 0

| accepted

Answered
how can use ode45 for differential equation system with time dependent data
ODE with Time-Dependent Terms

5 years ago | 0

Answered
plot the probability distribution from Schrodinger Equation
It gives a blank plot because the linspace calls are only producing one element. The third argument to linspace is the number o...

5 years ago | 1

| accepted

Answered
how do i find the interception of these two fuctions i1 and i2
This was a challenge! I tried this a couple times before I had an appropriate insight to calculating the intersection. (I ma...

5 years ago | 1

| accepted

Answered
inclined number in x-axis using scatter3 view(0,90)
That is the normal behaviour for the last few releases. One way to straighten the tick labels without having them overlap is ...

5 years ago | 0

| accepted

Answered
Plot area is empty
Use element-wise (array) division (./) instead of matrix division (/) and it works. (Matrix division will produce one value, ho...

5 years ago | 1

| accepted

Answered
Formatting Subscript, and Superscript in Text
Note that the sprintf call is not required for this, unless it is necessary to also print variables — text(0.4, 0.4, sprintf('...

5 years ago | 1

Answered
how to mark and print the intersecting coordinates of two lines
Much depends on what ‘x1’, ‘y1’ and the rest are. One approach (sssuming multiple intersections, although thiis will also wo...

5 years ago | 0

| accepted

Answered
why does the surf command give me this result?
I have no idea what the data are, or how the data are being plotted. If the colormap is gray the ‘brighter’ values are higher...

5 years ago | 0

Answered
Converting a 2D matrix from Cartesian coordinates to Polar
Converting it to polar coordinates using the cart2pol funciton is likely an option. .

5 years ago | 0

Answered
How to open a file of unknown type?
The ‘random characters’ likely mean that it is a binary file. If so, use fread to read it, although unless more is known about ...

5 years ago | 0

Answered
Complex representation of eigenvalues of a symbolic 2x2 matrix
This is likely as close as it is possible to get — syms a A = [0, 1; -1, 2*cos(a)]; lambda = eig(A) lambda = simpl...

5 years ago | 0

Answered
Find and replace value in a table
Try something like this — Country = {'Australia';'Germany';'Canada';'United Kingdom';'France'}; Location = Country(randi(nu...

5 years ago | 2

Answered
Reshape to column vector
Transpose ‘a’ before calling reshape — a = [1 2 3 4 5 6 7 8 9 10 11 12]; b = r...

5 years ago | 0

Answered
How to make the axis labels of a plot BOLD
The axis lables and titles are text objects. Try something like this — x = 1:10; y = randn(size(x)); figure plot(x, y)...

5 years ago | 1

| accepted

Answered
Equation to exponential eq using curve fit tool.
It will produce the correct values if it is allowed to. The ‘b’ value is 100 times greater than it should be, according to the ...

5 years ago | 0

| accepted

Answered
Why do I receive a subplot error?
That’s not how subplot works. It should be something like this — figure(1) hxl = subplot(2,2,1); scatter(height,leg) lsl...

5 years ago | 0

| accepted

Answered
How do I plot this Fourier series funcion?
I am not exactly certain what you want to do, however the loop is likely not necessary, sinc it is prefgerable to use MATLAB’s v...

5 years ago | 0

Answered
How to provide gaussian fitting of spectrums with multiple peaks ?
A version of that is actually provided in the findpeaks documentation (see Determine Peak Widths) and by getting all the outputs...

5 years ago | 1

| accepted

Answered
how to obtain single value answer from numeric expression
One option is the vpa function — syms x Ixx=int(x^4*sqrt(1+4*x^2),0,.5) Ixx = vpa(Ixx) .another one is double, depending on...

5 years ago | 1

| accepted

Answered
Turning a product of two vectors into a matrix without using for loops?
I believe something like this should do what you want — x = 1:10 y = 11:20 M = x(:)*y Using ‘x’ as x(:) forces it to become...

5 years ago | 1

| accepted

Answered
saving matrix using fprintf in .txt file with different formatSpec
Try something like this — data=[2 0.232 0.333 0.421 0.111;3 0.111 0.252 0.385 0.600;4 0.500 0.620 0.100 0.210]; fid = 1; ...

5 years ago | 1

| accepted

Answered
How can I use generated time vector in the main program in subprogram ?
I do not understand the question you are asking. It is certainly possible to pass a time vector to a different function that ...

5 years ago | 0

Answered
Fitting a simple digital signal from noisy measurements (piecewise linear fitting?)
I cannot find a built-in function that incorporates a slew rate, so so programming it yourself would be necessary. One option...

5 years ago | 0

Load more