# VBBV

### PEC

Programming in MATLAB applied to interdisciplinary engineering fields

**Statistics**

RANK**66**

of 275,645

REPUTATION**2,412**

CONTRIBUTIONS

**25** Questions

**834** Answers

ANSWER ACCEPTANCE **
88.0%
**

VOTES RECEIVED**193**

RANK**4,600** of 18,567

REPUTATION**272**

AVERAGE RATING**3.00**

CONTRIBUTIONS**12** Files

DOWNLOADS **57**

ALL TIME DOWNLOADS**2624**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

When defining an anonymous function, how do I utilize cell indexing of an intermediate function?

Try something like below epsTarray = @(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10) ... expression y = epsTarray(n(1),n(2),n(3),n(4),n(5...

6 hours ago | 0

How can I rectify this error? 'Invalid use of Operator.' 'Too many Output arguements'

%Input % MU_X [n x 1] Expected value of x. % SIGMA_X [n x n] Covariance of x. % A [m x n] Linear...

1 day ago | 0

Issues plotting simple bar graph.

A = [0.1; 0.4; 1.1; 2.2; 2.5; 0.2; 2.5; 2.2; 1.1; 0.4; 0.1]; B = [25; 20; 15; 10; 5; 0; 5; 10; 15; 20; 25]; bar(A); xti...

2 days ago | 0

| accepted

The numbers do not appear in standard format despite the writing (format shortG)

Use %f format specifier format shortG Mf=6.480554950317725e+03 Cp_sea=3.976; t_out=100; t_in=25; Qu=Mf*Cp_sea*(t_out-t_...

2 days ago | 0

what is the meaning of this error? how to stop this error?

If you have function % assuming the below line is not present as per your comments % For context, I am using this as a calli...

3 days ago | 0

Getting Naan error while integrating with multiple parameters

h=6.63*(10^-34); k=1.381*(10^-23); c=3*(10^8); T=6000; fun = @(x) (2*h*(c.^2)).*(x.^(-5)).*(exp((h.*c)./(k*x*T))-1).^(-1);...

6 days ago | 0

Error using plot. Data must be numeric, datetime, duration or an array convertible to double.

% syms n A0 = 5/4; An= 0; T = 2; Wo = pi; t=linspace(0,5*T,1000); Arm = 5; hold on for n=1:1:Arm Bn = (5*(-1)^n)/(...

6 days ago | 0

Multiple subplots having same legend

Read this page https://in.mathworks.com/help/matlab/ref/sgtitle.html

6 days ago | 0

How to put NaN in certain row of particular column according to another column having NaN in some row

data.Pyrn2_Avg(isnan(data.u_py)) = NaN; % assign NaN to this line

7 days ago | 0

| accepted

how can i solve this angle between vectors?

a = 3; b = 5; c = 7; alpha = acosd((a.^2 + b.^2 - (c).^2)./(2*a*b))

7 days ago | 0

What is the problem with the below code?

diff30 = (drugs30 - placebo30)./ placebo30 * 100;

7 days ago | 1

For loops step through time and update variable

C=100; dL=0.01 L=0:dL:0.2; % size 21 A=zeros(size(L)); B=zeros(size(L)); A(1)=300; % initial value for A ...

8 days ago | 0

How can i plot the graph from the 3 variables equation ?

A = 0:500:2000; B = 0:1:100; [AA BB] = meshgrid(A,B); X = AA.*(BB+25); surf(AA,BB,X) xlabel A ylabel B zlabel X

8 days ago | 1

| accepted

Why is my integration output the mathematical expression and not the solution?

func = @(x) ((x.^3.*cos(x./2)+1/2).*(sqrt(4-x.^2))); integral(func,-2,2) If you use *integral* it will work as you expecte...

9 days ago | 0

How to add number from equation to array and display it on chart

clear all; close all; clc; Time(1) = [0]; Quantity(1) = [0]; N0 = 100 ; tD = 5; t = 10; r=log(2)/tD for i=1:length(...

9 days ago | 0

| accepted

How to change the position of power of colorbar ?

[X,Y] = meshgrid(-1000:10:1000); Z = exp(-(X.^2+Y.^2)/1E5)*1E6; figure surf(X,Y,Z, 'EdgeColor','none') grid on colormap(h...

10 days ago | 1

Reference to non-existent field 'data'.

Use small k, in place of K , Matlab is case sensitive P='C:\Users\Lenovo\OneDrive\Desktop\NB_veh_files'; ...

12 days ago | 0

Function might not be used error

amount=bill-tip;% typo with operator There is a typo for the operator in the above line which presumably makes Matlab think...

13 days ago | 1

why this loop is not working? Actually p_j value is not changing why?

n = 10;% e.g. input number epsilon_ci = 0.001; epsilon_max = 0.01; xu = 2; fc = 100; D = 1.1; p_i = 0; %outside for loo...

14 days ago | 0

use green therom to find counter clockwise circulation and outward flux

% Define the vector field F syms x y F = [7*x-3*y, 7*y-3*x]; % Define the integrand as a symbolic expression for Circulatio...

15 days ago | 0

can you help me to solve this equation?

syms x real P = sqrt(27.8*exp(5*x)-1) == acos((120*x^2+sqrt(2*x))/(17*x-65)); % better to use acos function s = double(vpasol...

15 days ago | 0

Finding the roots across a range of values

H = 0.1; I = 200; Y = 0; b = transpose(1:I); for i = 1:I b(i) = fzero(@(b)(b*tan(b)-H),b(i)); BI(i) = b(i) ; end

15 days ago | 0

Two Quadratics are equal find K1 and K2 cancel out X

A =[1 -1; 0 0]; B = [0; 1]; MC = ctrb(A,B); %Gives controllability matrix det (MC) %Not zero so is controllable syms K1 K2 ...

17 days ago | 1

| accepted

How to on/off a variable after 3 seconds interval

led1=0; aa=3; tic T = toc while T<=90 pause(3); led1=1; pause(3); led1=0; toc; T = to...

19 days ago | 1

How to extract the correct data with regexp?

Use match option in place of 'tokens' in the line tokens = regexp(DATALow, '\<(R\d{2}[A-Z]?)/.*?(\d{4})[A-Z]*(?:(?:\d{4})[A-Z])...

19 days ago | 0

How can I construct a triangle function, when I tested one using 'integral(fun.-pi,pi)', error occurred.

integral(@triangle,-pi,pi,'ArrayValued',1) % call function using function handle function [a] = triangle(n) a=zeros(size(n)...

20 days ago | 0

| accepted

How to pass the signal x(t) in IIR band stop filter? Kindly develop the program for the following...... please.....

fs=5200; t=0:(1/fs):1; x=2*sin(400*pi*t)+3*cos(900*pi*t)-0.5*sin(1400*pi*t)+sin(2400*pi*t); figure % original signal plot(t...

20 days ago | 0

Why doesn't it work ?

s = 1.25; t1 = 0:0.01:pi/2; t2 = pi/2:0.01:pi; t = [t1 t2]; p=[4*sin(2*t1).^2.*exp(-(t1/s).^2)+2 4*sin(2*t2).^2.*exp(-(t2/s...

20 days ago | 0

fluctuations with specified mean velocity and amplitude

plot(t,v+V,'-*') hold on plot(t,V) Do you mean the above ?

23 days ago | 0

Why Can't int Find a Simple Integral?

Tips In contrast to differentiation, symbolic integration is a more complicated task. If int cannot compute an integral of an ...

24 days ago | 0