# VBBV

### PEC

Programming in MATLAB applied to interdisciplinary engineering fields

**Statistics**

RANK**59**

of 281.877

REPUTATION**2.842**

CONTRIBUTIONS

**26** Questions

**1.078** Answers

ANSWER ACCEPTANCE **
92.31%
**

VOTES RECEIVED**231**

RANK**4.516** of 19.063

REPUTATION**289**

AVERAGE RATING**3.00**

CONTRIBUTIONS**12** Files

DOWNLOADS **32**

ALL TIME DOWNLOADS**2793**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

why is this code not running?

plot(TimeValue, Pdispatch(:, 1), 'Color','r', 'LineWidth', 2);

ongeveer 2 maanden ago | 0

Error: variable might be used before it is defined.

Change this line yy2 = Pr*(y(4)*y(2)-y(1)*y(5)-Df*yy3-Nb*y(5)*y(7)-Nt*y(5)^2) to yy2 = Pr*(y(4)*y(2)-y(1)*y(5)-Df*y(3)-Nb*y...

ongeveer 2 maanden ago | 0

Why am I getting the error "Array indices must be positive integers or logical values" in MATPOWER?

The problem is with nested matrices bs or n2i matrices. % brs = ( mpc.branch(:, BR_STATUS) & ... %% branch status % ...

ongeveer 2 maanden ago | 0

Conversion of symbolic expression to double without obtaining complex numbers

oneway, is to use a conditional statement for negative input values through abs function. But if you want to avoid complex va...

ongeveer 2 maanden ago | 0

argument suggestion with shared argument validator

function s = fun3(a) arguments a {mustBeMember(a,@dummyClass)} = "a" end ...

ongeveer 2 maanden ago | 0

Matlab App designer export figure

% File exchange exportfig(app.UIAxes,"test") % Standard matlab function savefig(app.UIAxes,"test.fig") % exportgraphics ...

ongeveer 2 maanden ago | 0

f(x)=3x^3-5x^2+3x-7=0

x(1) = 0; % assuming x(1) = 0 kk(1)=1; for k=1:100; fx=3*x(k)^3-5*x(k)^2+3*x(k)-7; % use multplication operator for pro...

ongeveer 2 maanden ago | 0

How can I fix this error?

shipweightpmf( [2 2.5 6] )' function y = shipweightpmf(x) s = (1:8)'; p = [0.15*ones(4,1); 0.1*ones(4,1)]; y = finitepmf(s,...

ongeveer 2 maanden ago | 1

| accepted

How to disable a block in library ?

You can either use *switch-case* statements for controlling the execution of service meter blocks or a *function call* to trigge...

ongeveer 2 maanden ago | 0

Add values from vector to plot title

title({['Unit Step Response of G(s) = \omega_{n}/(s^2 + 2\zeta\omega_{n}s + \omega_{n}^2)'], ... ['\zeta = ', num2str(...

ongeveer 2 maanden ago | 0

how to create stack with multiple images?

b=cell(7,9); I_max=cell(7,9); I_stack_store=cell(9,1); for t=1:9 for i=1:7 I= rand(50,10,3); b{...

ongeveer 2 maanden ago | 0

| accepted

How to plot simulation results in a GUI while the simulation is running?

Use drawnow command for updating the simulation results Read more about the command here https://in.mathworks.com/help/matl...

ongeveer 2 maanden ago | 0

save images in array in two for loops

b=cell(7,9); for t=1:9 for i=1:7 I= rand(34,78,2); % image data b{i,t}=I; end end b = b(:)

2 maanden ago | 0

| accepted

Getting the Wrong Output While Using Image Batch Processor

possibly you are calliing the function porosity_function inside a loop, which repeats 12 times and storing the output for all im...

2 maanden ago | 0

a function just valid over a certain range

x = 0:0.1:10 ; for k = 1:length(x) if x(k) >= 2 & x(k)<= 8 y(k) = x(k).^2+3.*x(k)+1 ; else y(k...

2 maanden ago | 0

| accepted

error in multiplying symbolic variable in a matrix

clear clc syms z L [1 11] z , L x=[0 300 1000 1500 1700 2000 3000 3300 4000 4500 5000]; y=[32.0 122.4 296.4 405.7 447.6 60...

2 maanden ago | 0

How to write the output of matlab iteration results of many equations in excel in row by row specifying the starting row?

k = 1; for Xref1=0:0.1:1 % Loop through the range of inputs Xref1; Hi=Xref1*10; Lo=Xref1*5; out_put(k,:...

2 maanden ago | 0

Stateflow onramp unreachable state task 4 error

Did you give the conditions & condition actions also from previous tasks ? It looks like you've added only transition

2 maanden ago | 0

simple function plot in MATLAB

Hi @Sanjida Use element wise division for evaluatiing the vector Y, It seems you have used incorrect operator ' \ ' this is...

2 maanden ago | 0

Properties of exponentials - symbolic algebra

Hi @Luca Lazzizzera You can of course use simplify as @Mischa Kim mentioned. However, if you want to obtain the simplified ex...

2 maanden ago | 0

How to design a robust PI controller based on the Sensitivity peak value

Define or write these lines of code before the symbolic equation M_eqn. This equation contains two undefined variables, alpha a...

2 maanden ago | 1

How to convert a symbolic matrix into matrix polynomial

syms x N = [1 5-3*x 0;0 1 5-3*x;1 0 x^2-5] K = poly2sym(N,[x]) simplify(K)

2 maanden ago | 0

Scatter plot does not display multiplied values

If I add multiplication by a constant, the vectors are scattered well with the new values, but the numbers are not This is some...

2 maanden ago | 1

Splitting numbers of vector in multiple parts

If you want to split array of numbers, but using a loop , here's one way V = string([2022024 2023074 2022044 2023014 2023054])...

2 maanden ago | 0

Is it possible to set gca for all subplots?

yes, its possible to set the YTick to [ ] for all subplots you want by using axes handles for individual subplots as shown bel...

2 maanden ago | 0

Insert number in polynomial

You can use symsum function in place of for loop. since polynomial p is function of x, its easier to use symbolic summation fo...

2 maanden ago | 0

Can someone please help! I cannot plot this graph. Multiple 3 line graph.

clear; clc; r = 0.05; %radius in meter viscosity = [256E-3, 544E-3, 1200E-3, 3680E-3, 5440E-3]; %viscosity in pa.s l = 0.0...

2 maanden ago | 0

| accepted

Equation in the exported text file is truncated

fprintf(fileID, '%50s\t %50s\n','mu33_1 = ', Solution); Since you want to print *mu33_1* and *Solution* as characters to the fi...

2 maanden ago | 0

| accepted

Reading an Array Data from the Serial Port

data=read(s); Try using *read* function which has option to read how many data samples you want at a time. It also allows t...

2 maanden ago | 0