# VBBV

### PEC

Programming in MATLAB applied to interdisciplinary engineering fields

**Statistics**

RANK**69**

of 271,205

REPUTATION**2,068**

CONTRIBUTIONS

**24** Questions

**643** Answers

ANSWER ACCEPTANCE **
87.5%
**

VOTES RECEIVED**158**

RANK**4,736** of 18,292

REPUTATION**256**

AVERAGE RATING**3.00**

CONTRIBUTIONS**12** Files

DOWNLOADS **82**

ALL TIME DOWNLOADS**2469**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

how to replace/import .mat file with parameter values?

A = load(websave('X','https://in.mathworks.com/matlabcentral/answers/uploaded_files/1213353/torque_for_Sid.mat')) speed = 1000/...

8 hours ago | 0

fprintf results into 2 columns

clc; clear; close all; principal = 1000;%input('Enter Principal in Dollars: '); years = 5;%input('Enter Number of years: '); ...

14 hours ago | 2

| accepted

copy corresponding values of 2nd metrics depend on 1st metrics values

Z=[]; ii=0 Z2=[]; iii=0; Z3=[]; iiii=0; X = rand(10) Y = rand(10) [RawX, ColX]= size(X) for j=1:RawX; for n=1:ColX...

15 hours ago | 0

Create an alternating matrix

maxV = 20; stepS = 5; I = zeros(1,2*(maxV/stepS)+1); I1 = 0:stepS:maxV; I2 = -I1(2:end); I(1:2:end) = I1; I(2:2:end) = I2;...

16 hours ago | 0

I am getting error while trying to generate data for qtot_eV through variation of "d".

As the error states, you need to provide scalar values for integral limits betaevanmax=10./max(d); % use a scalar value for up...

18 hours ago | 0

| accepted

my code output is right but my graph gives me nothing it's blank and I don't know why it wont work there are no error just gives a graph with nothing on it

Use loop index if Price(i) < buy stock(i) = stock(i)+25; % use loop index ... elseif sell < Price(i) stock(i) = stock(i...

18 hours ago | 1

| accepted

Plotting a line using one point and a slope in the loglog scale

x = (25081:1000:10000000); m = -3.62; x1 = 25081; % use coordninate y1 = 3.046e-16; y = m*(x-x1)+ y1 loglog(x, abs(y)) % ...

1 day ago | 0

Run a function inside a for loop 10,000 times and record the 3 separate outputs for each trial

Sl(trials) = S; Ml(trials) = M; Ll(trials) = L;

2 days ago | 0

Creating a specific time subplot

%hold on. Comment this line subplot(2,1,2) Comment the line above

2 days ago | 0

| accepted

Error in Euler's method code.

You can use the below approach for implementing your problem clc clear all close all h=0.01; N=120; % number of steps ...

2 days ago | 0

Hold on and Hold off command keeps all plots on subsequent graphs

figure(1) fplot(eqn1,[0,4*pi]) hold on fplot(d_eqn1,[0,4*pi]) figure(2) fplot(eqn2,[-10,10]) hold on fplot(d_eqn2,[-10,...

2 days ago | 0

Unable to perform assignment because the left and right sides have a different number of elements.

K=zeros(1,4100); L=zeros(1,4100); Check the size of vectors K and L

3 days ago | 0

How can I change the title of a figure through each iteration of the loop?

close all; clear variables; clc; % % For Phi/Psi = +/-10 CoverageArea_mean_10 = {[84.4735,21.1779,6.4247,2.1416],[45.2112,...

3 days ago | 0

How can I get a profit function P(x,y) using a cost function C(x,y) and a revenue function R(x,y)

x = 1; y = 1; % assume some input values R = @(x,y) 6*x.*y + x.^2; % use funciton handle to define the equations C = @(x,y)...

4 days ago | 0

How to make the condition for checking the matrix value ?

popnew1 = 2-A(mutated);

4 days ago | 0

| accepted

Value of the array in calculation and graph is different

format long k=10; Es=0.05; t=273; TempK=0:1500; cp=0:0.2:1.2; cp=0.99403+((1.671e-4)*(TempK))+((9.7215e-8)*(TempK.^2))-((9...

4 days ago | 0

Index exceeds the number of array elements. Index must not exceed 751.

M(n)=M(n)-(dM*dt);

5 days ago | 0

| accepted

how to solve error using horzcat dimensions of array being concatenated are not consistent

You can transpose the output of ode23 as follows y(j,:)= [i, x(:,1).']; % transpose col matrix plot(y,'r.'); drawnow

5 days ago | 0

The following error occurred converting from sym to double: Unable to convert expression containing symbolic variables into double array..

syms theta1 theta2 t=[0.01:0.1:10]; l1= 50; l2= 50; l3= 10; dt = 1; x2 = l1*cos(theta1) x3 = l2*cos(theta1+theta2)+ x2;...

6 days ago | 0

| accepted

Driving force of driven damped harmonic oscillator missing

c0=299792458; %speed of light lase_lambda = 1064e-9; %wavelength lase_freq = c0/lase_lambda; w0 = 2*pi*lase_freq; ...

7 days ago | 0

Analytical Solution of Double Integral in Symbolic Math

syms x a = 2; sol = int(sin(x).*(a.^2*cos(x).^2 + sin(x).^2/a).^(1/2),x,[0,pi]) vpa(sol) % use vpa

7 days ago | 0

| accepted

Plot title keeps rewriting on top in livescript

close all % add this line at begin x=linspace(0,5,100);

8 days ago | 0

| accepted

polar plot of n^2 = 1+g equation

About the 2nd equation, you can plot it straightforward by plugging values for variables g and theta theta = 0:pi/100:2*pi; % ...

8 days ago | 0

What is wrong here? The equation of a circle given its center

syms x y R e1=(x+1)^2+(y-3.2)^2==R^2; e2=(x+8)^2+(y-4)^2==R^2; e3=(x+6.5)^2+(y+9.3)^2==R^2; result=solve([e1,e2,e3],[x y R])...

9 days ago | 0

| accepted

how to assign the service time value of the first entity server to the second entity server?

You can try by putting an additional *entity* block between first server and second server. Assign the output of first server to...

9 days ago | 0

Repeat resampling with replacement process several times

res1 = []; res2 = []; centered = rand(170,7) % centerd matrix size:2X7 % cen1=centered(1,:); % cen2=centered(2,:); fo...

9 days ago | 0

| accepted

Why does this code not work?

D =90 ; V = 6.672408424 ; mean_D = 90 ; mean_V = 6.6724 ; sigma_D = 10.29023 ; sigma_V = 0.67708 ; %Now use normrnd functi...

9 days ago | 0

Why is there extra data in my graph?

x =fig.eventsTOP.Event_Type; y = fig.eventsTOP.GroupCount; % bar(x,y)

10 days ago | 0