Answered
Error using surf (line 71) Data dimensions must agree.. How to rectify this error.
There are too many missing parts to run the posted code. See if this works — surf(t,r,T) .

5 years ago | 0

Answered
Getting an indexing error
In MATLAB, indices must be integers greater than 0. This illustrates a way to get some of the data and plot it — Uz = unzip...

5 years ago | 0

| accepted

Answered
Time between excitation wave and received waves
Try this — F = openfig('sample.fig'); Ax = gca; Lines = findobj(Ax, 'Type','line') sent = findobj(Lines,'DisplayName','Ex...

5 years ago | 0

| accepted

Answered
curve fitting tool plot is different from my plot
I haven’t. Try this, and compare it with your (unposted) code — x = [1.34673 1.35171 1.3531 1.35402 1.35636 1.35875 1.3608 ...

5 years ago | 1

| accepted

Answered
How to solve a function with different ranges
alfa_fcn = @(C_ox) min(C_ox/15,1); C_ox = [16;15;7.5;2;7.5;15;15]; alfa = alfa_fcn(C_ox) .

5 years ago | 0

| accepted

Answered
Finding the indices of the maximum k elements (even if repeated)
One approach — A=[1 1 0 0 2 0 3 3 0 0]; [Amax,idxmax] = maxk(A,3) See the documentation on maxk (introduced in R2017b) for d...

5 years ago | 1

| accepted

Answered
How to create concentric circles?
x_center = 0; y_center = 0; pellet = 0.3355; gap = 0.350; w14re = 0.354; re = 0.355; clad = 0.455; sicfib = 0.458...

5 years ago | 0

| accepted

Answered
Butterworth bandpass filter on a signal using buttord and butter
The transfer function implementation created an unstable filter. Instead, use zero-pole-gain output from butter, then impleme...

5 years ago | 1

| accepted

Answered
Searching for structures in signal
Try this — t = linspace(0,25, 500); % Create Data signal = sum(sin(0.5*rand(5,1)*2...

5 years ago | 0

| accepted

Answered
Root locus imaginary axis intersection
Try something like this — sys = tf([3 1],[9 7 5 6]); % Example From The Documentation [r,k] ...

5 years ago | 0

| accepted

Answered
I can't detect error in formula
The error indicates that the exponentiation needs to be element-wise, using .^ rather than ^ — T3(t,1)=(((q_inc.*z_env.*d_abs)...

5 years ago | 0

Answered
Subroutine using if statement
I generally favour this sort of approach to such prolblems — X = @(x) ((x>=2).*5 + (x<2).*4) + 2; x = 0:20; k = X(x); y =...

5 years ago | 0

| accepted

Answered
Unable To Find Explicit Solution [Empty Syms]
There is no function called ‘T’ so ‘T(0)’ is not defined. Try this instead — syms I(t) Mu To t %Used to decalre variables a...

5 years ago | 0

| accepted

Answered
Merging overlapping circles and remove the union part
One approach — t = linspace(0,2*pi,500); % Allow Adequate Resolution For Best Re...

5 years ago | 1

| accepted

Answered
Creating for loop for a piecewise function
One problem is that MATLAB subscripts are integers greater than 0, so setting ‘V’ to 0 and using it as a subscript will fail. ...

5 years ago | 0

| accepted

Answered
"Array indices must be positive integers or logical values" for i=2 in loop
The error that throws when I run it in the online Run feature has to do with: Fxy2II=@(xxII,yyII,ffiII) 1/E*I*(-3*p*a-p(xxII-a...

5 years ago | 2

| accepted

Answered
FiltFilt function giving NaN values
The signal itself (as well as the value of ‘srate’) may be important here. (The factor of 2 is not necessary.) I have no ide...

5 years ago | 3

Answered
error using fzero in line 6
Try something like this — hw7 % Call Function function hw7 fun = @(e) hw7f...

5 years ago | 0

| accepted

Answered
Ho do I use symbolic expressions to define a new function?
See if this slight revision of the posted code does what you want: f = @(t) cos(t); % L = integral_a^b(sqrt(1+f'(t)^2)dt df ...

5 years ago | 0

| accepted

Answered
Find min and max values in a constant interval.
The findpeaks function works, however it needs help to detect correctly the maxima and minima. Try this — opts = detectImpo...

5 years ago | 1

| accepted

Answered
Multiple plots in a single graph
It is necessary to create them in a loop, storing them in a cell array. After that, a single call to the functions works — m ...

5 years ago | 0

| accepted

Answered
Hi , can someone help me in printing the following expressions using matlab.
See: The Not So Short Introduction to LaTeX2e for reference. .

5 years ago | 0

| accepted

Answered
Initial conditions problem ODE15S
I will copy and run that (again) if necessary. In the interim, see if actually calling the plot function works — figure pl...

5 years ago | 0

| accepted

Answered
I need to convert comma ',' to dot '.'
One option in detectImportOptions (introduced in R2016b and updated in later releases) in Parameters for Text Files Only allows ...

5 years ago | 0

Answered
Date stamp on plot
The only way I can devise to delete the date is to create new y-tick labels and use them instead — F = openfig('untitled.fig')...

5 years ago | 0

| accepted

Answered
Using trapz just for positive areas
I would just use interp1 to interpolate the data, then use trapz to integrate it. The resolution of ‘xi’ determines the precisi...

5 years ago | 1

| accepted

Answered
How do I edit this bar graph? Y-axis thickness and ticks
See if the YAxisLocation and other Axis Properties and Numeric Ruler properties will do what you want.

5 years ago | 0

| accepted

Answered
Plotting an amplitude spectrum of a .txt file
Try this — D1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/647750/spec.txt'); signal = D1; L...

5 years ago | 1

| accepted

Answered
Draw arc with specified angle difference
Try this — LD = load('Data.mat'); Data1 = LD.Data1; A1 = Data1(:,1); R1 = Data1(:,2); D1 = Data1(:,3); Data2 = LD.Data2...

5 years ago | 0

| accepted

Answered
Plotting sine wave for voltage with variation of frequency
I am not certain what the desired result is. If the frequencies and amplitudes are fixed with respect to time, try this — t...

5 years ago | 0

| accepted

Load more