Community Profile

# VBBV

### PEC

Last seen: Today Active since 2017

Programming in MATLAB applied to interdisciplinary engineering fields

All

#### Content Feed

View by

Contour not being rendered for non-finite data??
%crack length - for Kanalytical a = 0.1; K = sqrt(pi*a)*1000; %grid for results to look like plate, adjusting for crack edg...

ungefär en timme ago | 0

Physics costing electricity, KW/KWh
% assume P_rating = 2e3; % 2000 W = 2kW number_units = 50/7.5 % since each unit is treated as 1kWh @ 7.5p per unit run_time...

ungefär 12 timmar ago | 0

Adding multiple cylinders into the same model PDE Toolbox
model.Geometry = [SC3d VS3d]

ungefär 15 timmar ago | 0

How do I exit a for loop after logical index is found true in an array?
use inside the if-end statement % check if trajectory goes through the zone result = false; for i = 1:length(xNormalized) ...

ungefär 20 timmar ago | 0

| accepted

How to parameterize function.
syms x y z P = [x^2 +2*y +3*z; x*y -2*z^2] subs(P,{x,y,z},{t,t,t})

en dag ago | 0

"Matrix dimensions must agree" when trying to plot the sum of a sin function
s2 = sin((2*m-1)*x)./(2*m-1); Use element wise division

en dag ago | 1

| accepted

Vectorize application of xcorr() function
t = 0:1e-3:1-1e-3; AF_hat = []; fd_ = linspace(-8,8,length(t)); s = 1; Ts = 10; AF_hat = xcorr(s,s.*exp(-1i*2*pi*fd_.*t))...

en dag ago | 0

Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
The element wise power for a scalar should not affect much on your calculation unless vectors are multiplied or raised to power ...

en dag ago | 0

Z must be a matrix, not a scalar or vector.
t=0:30 % a vector x=(1+0.25.*cosd(45.*t)).*cosd(t); y=(1+0.25.*cosd(45.*t)).*sind(t); [X,Y] = meshgrid(x,y) % X and Y matr...

2 dagar ago | 0

Could anyone tell me why I am getting an error with "else" in my code. This is my first time using this software and I am very confused.
This is standard syntax for if-else statements in matlab if condtion ... elseif condition ... else ... end

2 dagar ago | 0

error: Index in position 2 exceeds array bounds (must not exceed 31).
clear all clc %Geometry definition L=0.3; %Length of the The rectangular bar in meter W=0.4; ...

3 dagar ago | 0

Is there a way of getting displayFormula to print multiplication symbols in an equation?
syms a b strEquation = "a*b"; disp(strEquation)

3 dagar ago | 0

The conditions seem wierd, considering random number series .as inputs m=4 syms i; % t = 50; for t=2:50 x(t)=randi([0...

3 dagar ago | 0

My code is giving me a straight line for values of N other than 5
clear variables close all M = 250; % The length of each function t = -5:0.1:5; y = zeros(1,M); % Initiallize the sum to zero...

3 dagar ago | 0

For loop not stopping
if ismember(-9999,aspect(i,1)) Check using ismember

3 dagar ago | 0

Bar graphs don't group bars if there is only one group in the data
like this ? % Artificial data: Two vertical vectors of height 3 x=reshape(randperm(6),3,2) % Correct grouping into pairs s...

4 dagar ago | 1

| accepted

Using listdlg along with case statement
A = [15 22 25 17 7 3 2 2]; B = [17 23 27 15 5 2 1 1]; % ---^^^^^^^^ these values in B are higher compared to A length(B) le...

4 dagar ago | 0

Change plot scale y axis
u21=[224 224 224 223 218 218 217]; beta1=[0 0.19 0.26 0.38 0.76 0.83 0.9]; plot(beta1,u21,'-*'); xlabel('beta') ylabel('U[V]...

4 dagar ago | 1

Bar graphs don't group bars if there is only one group in the data
% Artificial data: Two vertical vectors of height 3 x=reshape(randperm(6),3,2) % Correct grouping into pairs subplot(1,2,1)...

4 dagar ago | 0

Taking derivative and putting it equal to 0 to find theta.
syms x s h S = (6*s*h) - ((3*s*s*cot(x))/2) + ((3*s*s*sqrt(3)*csc(x))/2) Y = diff(S,x) == 0 % take derivative of equation w....

4 dagar ago | 0

I want help solving differential equations
syms x y(x) eqn = diff(y(x),x)+sqrt((1-y^2)/(1-x^2))==0 cond = [y(0) == 1;y(1) == 0] % check with some other initial conditio...

4 dagar ago | 0

| accepted

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

5 dagar 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: '); ...

5 dagar 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...

5 dagar 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;...

5 dagar 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...

5 dagar 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...

5 dagar 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)) % ...

6 dagar ago | 0