# VBBV

### PEC

Programming in MATLAB applied to interdisciplinary engineering fields

**Statistics**

RANK**77**

of 265,546

REPUTATION**1,756**

CONTRIBUTIONS

**24** Questions

**500** Answers

ANSWER ACCEPTANCE **
87.5%
**

VOTES RECEIVED**140**

RANK**4,853** of 18,135

REPUTATION**246**

AVERAGE RATING**3.00**

CONTRIBUTIONS**12** Files

DOWNLOADS **36**

ALL TIME DOWNLOADS**2366**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Loop through a timeseries and calculate values over a 20min interval

[X(i)] = pressure(d(i), dt, meth)

14 hours ago | 0

Insert a figure in a report on Web Apps

add(rpt,figure(f1)) Pass the function handle for figure with smallcase

19 hours ago | 0

How can I plot the fourier series of a rectangular pulse by calculating the coefficients?

close all; clear; clc; N = 2; f = @(x) rectangularPulse(-1,1,x); x = -2:0.001:2; %2*p is the period p = pi; % the main fun...

1 day ago | 0

Solving an equation with multiple values

f1 = ((2*69*0.3)./(pi*a))*0.5;

2 days ago | 0

| accepted

Loop for end before it should

f = 1 g = 2 for i = 1:(length(nb)) %length(nb) represent the number of items selected in the first listbox myExcel = actxserv...

2 days ago | 0

| accepted

Can Someone help me solve what is wrong with this code

%syms CP Comment this line and try as CP is symbolic. Then you get know whether it's maximum or minimum

3 days ago | 0

How to replace values of a variable in a table (in a cell) with nan?

mycell{5, 1}(1,1).myvariable = nan;

3 days ago | 0

| accepted

Draw vertical lines which have constant interval

P=[1:432] original_form = load('original_time.mat') time = datetime(original_form.t,'ConvertFrom','datenum') plot(time,P); ...

5 days ago | 0

| accepted

Help with a bifurcation diagram plot

lambda = linspace(0,125,100) xt = linspace(-0.1,5,100)

6 days ago | 0

| accepted

Index exceeds the number of array elements. Index must not exceed 20. Error in lumped_vortex_parabolic_camber (line 54) dx = xcollocation(i) - xvortex(k);

for i = 1 : 1 : Npanel % change In the first case you used this. But look at the 2nd for loop why you changed to 2*Npanel....

6 days ago | 0

Moving Decimal Places to the right

format long % format long option sprintf('%6f',1.412701202025964e+09)

9 days ago | 0

fprintf with warning of a lone trailing backslash

folderName = strcat(rootFolder,filesep,timeSteps(m+2).name); fprintf(['\nProcessing folder %s', folderName]); You need ...

9 days ago | 1

I dont get why I am encountering an error message when running this code.

%v_t=20; %v_i=1; %g=10; %expo1=-2*g*t./v_t; %expo2=-2*g*t./v_i; %function I want to integrate and plot:v_t*(1-exp(expo1)+v_...

10 days ago | 0

code no good :(

clc,clear all %% Load Data - Initilize Variables DP980TD_S2 = xlsread('DP980TD-S2.xlsx'); % Data File % Constants widthO...

11 days ago | 0

How can I get the value by choosing 't' and 'x'? ,How should I set the graph range?

L = 30; n = 10; T0=500; T1s=300; T2s=400; dx=L/n; alpha=0.000085; t_final=4800; dt=300; % use a coarse timestep ...

11 days ago | 0

Using nested FOR() loops to populate a matrix

% MacLaurin Series of e^x format longG % define vector to hold series x values X = 0 : 0.01 : 1; % Create matrix to co...

11 days ago | 1

| accepted

how to write a function for quadratic equation?

if (d>=0) & (~(a==0)) use binary operator &

13 days ago | 0

| accepted

Why is my loop not working? "Index exceeds array bounds"

%%%%%% DEFINITIONS %%%%%%% clear Q_lpm=15; Q(1) =(Q_lpm/1000)/60; %m3/s [INPUT] diameter = 0.01; % m [INPUT] t =0.01; % tim...

13 days ago | 0

interpolate (extrapolate?) the values in between two matrices using existing data

A = [1, 2, 3, 4, 5; 0.3654, 0.3634, 0.3663, 0.3665, 0.3677]; B = [16, 17, 18, 19, 20; 0.4653, 0.4636, 0.4652, 0.4620, 0.4715];...

16 days ago | 0

| accepted

I'm definitely doing the exponential distribution wrong, am I?

N = 1e4; a=0; b=1; x = (a+(b-a)*rand([N,1])); lambda = 11; % try with different lambda values Y = -log(x)/lambda; figure...

18 days ago | 0

speed up the for and if loop

for i = 1:10:300 % use step increments for j = 1:10:500 for k = 1:1000:17000 if(temp(i,:) > 2) ...

22 days ago | 0

ode45 keeps giving me the error shown below.

a = 0.459; lambda1 = 1.11*10^(-2); %units min^-1 lambda2 = 1.38*10^(-4); %units min^-1 Cp0 = 100; %units nM t = 0:7200; %uni...

22 days ago | 0

| accepted

ODE with Newton method

clear all close all n=1001 y0=1; xmin=0; xmax=10; x=linspace(xmin,xmax,n); %grid step=(xmax-xmin)/n; %Step Size yy=zer...

23 days ago | 0

Function output an array

in = [rand(1,15);rand(1,15)]; differences(in) function [out] = differences(in) %This function allows an array input and th...

1 month ago | 0

During simulation of mathematical model occuring following error

Use limit output option for selecting integrator saturation limits. May be in your case, its running indefinitely.

1 month ago | 0

Using function with a for loop

(factorial(i)).^2) You have two extra parenthesis for this term

1 month ago | 0

| accepted

Index location of certain dates with find and a loop

locs= zeros(length(TargetDates),length(t_list)); % change preallocated array size Change the preAllocated size of locs locs...

1 month ago | 0

why my code is running so slowly in the while loop

clc; clear all; close all; r = 1250; O = [2500 2500] Px = 2500; Py = 1000; P = [ Px Py ]; Va = 100; To = 4; q22 = 0.1 ...

2 months ago | 0

Summation of all odd numbers from 1 to 451

n = 451; a = 1; d = 2; S = 0; % Compute S by adding the terms for i = 1:n S(i) = (a+(i-1)*d/2); end sum(S(1:2:end)) ...

2 months ago | 1