# VBBV

### PEC

Programming in MATLAB applied to interdisciplinary engineering fields

**Statistics**

RANK**94**

of 250,422

REPUTATION**1,224**

CONTRIBUTIONS

**25** Questions

**959** Answers

ANSWER ACCEPTANCE **
84.0%
**

VOTES RECEIVED**117**

RANK**5,254** of 17,398

REPUTATION**208**

AVERAGE RATING**3.00**

CONTRIBUTIONS**12** Files

DOWNLOADS **45**

ALL TIME DOWNLOADS**2030**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How to plot a function dependent on no. of iterations, provided it plots till nth iteration where n is the number where the function is converged?

n= 10; e = 0; for m=1:n pu(m)=(-1)^m/((2*m)+1)*(exp(-((2*m)+1))) e = e+pu(m); if (abs(pu(m))/e)>(10^(-6)) ...

1 hour ago | 0

Colour options in plotting graphs

figure hold on cc = 'rgbmyck' for i = 1:7 subplot(211) plot(rand(10,1),'color',cc(i)) hold on title('oute...

3 hours ago | 0

Code-m file for Sampling

clear all close all % Creating modulating signal fm=2; % message signal frequency (Hz) n=50; % factor of sampling frequenc...

5 hours ago | 0

*.* and %s meaning in MATLAB

There are many symbols in your statement. What do you exactly mean by *.* or %s depends on the usage of symbols in your program....

9 hours ago | 0

How do I prevent my code from printing the ans statements?

for k=[2,3,4,5] X = randi([0,1],[k,4]); end X Place a semicolon at end of line.

13 hours ago | 0

how to linspace to create a coulmn vector

A = linspace(0,550,50).';% increasing AA = linspace(550,0,50).';% decreasing

13 hours ago | 0

trying to use heun's method to solve an ode

a = 0; b = 10; n = 100; h = (b-a)/n; % T = a:h:b; F0 = 0; w = 0; m = 4; k = 10; c = 0.2; y0 = 4; h=(b-a)/n; ...

1 day ago | 0

| accepted

how to replace 1 element in matrix

A = rand(4,5); A(3,4) = 75; D = A; You can assign the new matrix to old one after replacing the value with 75. Read m...

1 day ago | 0

How can i store the values for each of the 10 iterations of N. i want to store each and every value of the loop.

x_e(j,k,i,n) = x3(j,k,i); y_e(j,k,i,n)= y3(j,k,i); Just use index n instead of nn in for loops

1 day ago | 0

How to get Fourier transform of rectangular window as shown by wvtool function?. Why frequency domain of rectwin(M) using fft and wvtool are different?

_By default, the frequency domain plot is the magnitude squared of the Fourier transform of the window vector in decibels (dB)_ ...

2 days ago | 0

Dot Product of row vectors using loops not functions

result = dot(a1,a2) Why do you need a for loop ?

2 days ago | 0

Make scalar data into a vector

for i=1:length(x) a(i)=round(-19.93984628*x(i).^2-19.26822854*x(i)+28.63259561); %Use inverse matrix to form system ...

2 days ago | 0

Code not working?

clear; clc; % Given data E_f = 228000; % Elastic modulus of the fiber E_m = 1325; % Elastic modulus of the matrix G_f = 15...

3 days ago | 1

Unable to plot transfer function properly by using step(tf,array)

sys = tf(4,[1 2 10]); tt=0:0.0074:0.3; step(sys,tt)

3 days ago | 0

where is the mistake?

while count<15 if strcmp(w(count),'r') disp('yes') count=count+1; else break;% this will ...

3 days ago | 0

i have a function and i need to find the output of the last value. y(n)=1/2*(y(n-1)+A^2/y(n-1)) 0<=n<=N-1 (N=30 A=4),When i run it says output arguments not assignet.

function res = my_matlab_function(A,N) % res is te function output y(1)=1/2*(3+(A^2/3)); y(2)=1/2*(y(1)+(A^2/y(1))); for n...

3 days ago | 0

I have written the code for three differential equations for plotting the graph . I am not able to get the graph .

clc; clear all; close all; F = @(Z,X,Y) (1.07*Z*Z-Z*Z*Z-0.17*Z-(0.36*Z*X)-(0.0001*sqrt(Z*Y))/(1+0.2*sqrt(Z))) A = @(X,Y,Z)...

3 days ago | 0

Implicit matrix expansion correction

a = rand(11,21); b = rand(21,1); c = 21 a = reshape(a(a~=b.'),[],c) There is no error with your code. Maybe it's version...

3 days ago | 0

Nothing shows up on plot?

MM = 24; days = 1;i =1;% set value to counter while MM > 0 m(i) = MM; MM = MM - randi(5); MM = MM - 7; ...

4 days ago | 0

Ode45 not working in matlab 2021b

zdot=inline('[z(2);-0.2*z(2)-sin(z(1))]','t','z') Check your zdot function. There is no variable with _t_ defined in it...

4 days ago | 0

How can I remove some specific lines from this contour plot

Easy way is that you can select "Edit" option from the figure window after plotting and click on figure properties. Then click o...

4 days ago | 1

| accepted

Reading all values as a string from excel file

Use readtable or readmatrix instead of xlsread

5 days ago | 0

TASK 5 PROBLEM SIMULINK ONRAMP

Set the initial condition source to external and try

5 days ago | 0

Simulink Onramp 13.1 Task 5

Set the initial condition source to external from drop down menu.

5 days ago | 0

Matlab recommends me to apply 'subs' command but I have already used it to convert a symbolic matrix into a numerical one. What fails?

A_final=vpa(A_num,3); Check with _vpa_ instead of _double_

5 days ago | 0

Error when indexing 3D cell array: Index in position 2 exceeds array bounds

N = block_size*ceil(numel(participants{i,2})/block_size); Try changing this line to above. It seems you are using _numel_ f...

5 days ago | 0

How Do I Properly Format my Bar Graph?

x = [379.5 , 1138.3 , 1897.2 , 2656]; % your values y = rand(size(x)); bar(x, y) xlabel('Number in the Thousands (ie 4,000)'...

6 days ago | 1

Getting a blank graph

syms theta1 grid on w2 = @(theta1) ((cos(pi/6)*(sec(theta1)).^2)./ ((tan(theta1)).^2+(cos(pi/6)).^2))*2*pi; theta1 = 0:pi...

7 days ago | 0

why do I keep getting this error message

t = 0:1/320:0.5; x = @(t) 6*cos(4*pi*t)+2*sin(16*pi*t) -4*sin(32*pi*t);% define anonymous function x(t) plot(x(t))

7 days ago | 0