Answered
Why am I getting an error for mismatched number of elements?
Few changes that may be required are below. Test your code after those changes x = zeros(n,1); for i = 1:n .. S = ...

3 years ago | 0

Answered
How to pass on arguments in the form of two grids and return a matrix the elements of which involve conditional statements?
N = 4; DT = 1/N; t = linspace(DT/2, 1-DT/2, N)'; r = t + 0.3 * DT; [rr, tt] = ndgrid(r, t); a = f(rr, tt) function ...

3 years ago | 0

Answered
How to extend a vector continuously in a loop
ini_vector=[par.nN2_in par.nH2_in 0 0 0.01 0 0 0 0 0.999]; Initial = repmat(ini_vector,1,8)

3 years ago | 0

| accepted

Answered
2D array to 1D with rows appending after another row
A = A.' A(:)

3 years ago | 1

Answered
I need help plotting using this while loop
xx = linspace(-5,9,85); w=0 while w<85 w=w+1; fxx(w) = ((xx(w)+1)^2)./(2+5*xx(w)); end plot(xx,fxx)

3 years ago | 1

| accepted

Answered
My Code is giving indexing error, I am unable to fix it.
one way to verify the exact and approximate solutions is to vary boundary conditions suitably , % Clear all variables and clos...

3 years ago | 0

Answered
I am trying to do numerical integration to find the work out in a problem with less than 0.1% error.
From your comments in the code, as i understand if the temperature is < 300K , then efficiency is not possible to evaluate. I h...

3 years ago | 0

Answered
I'm running into an error at line 40, which is prompting me that I have an "invalid or deleted object". I'm wondering how to mend this.
P0 = [1,2,3]; P1 = [2,4,5]; P2 = [3,4,5]; P3 = [50,2,3]; P = [P0;P1;P2;P3]; t = linspace(0,1,100); tint = length(t); A = one...

3 years ago | 0

Answered
how to transform a table with column names into an double array without column names
X = table2array(X(:,2:end)) Try as above

3 years ago | 0

Answered
im trying to model the drive train model of wind turbine, i need to get oscillation and the steady state waveform
Provide all inputs to the equations used for modeling the drive train, clc clear all close all a=3.2; %input('Enter the a =...

3 years ago | 1

| accepted

Answered
How to build a vector in MATLAB
Labels = 16; r = 6; C1 = 1:Labels C_labels_train = (repelem(C1,r))' C_labels_test = [C_labels_train; C_labels_train; C_labels...

3 years ago | 0

| accepted

Answered
Hi everyone, why do I receive "Test Results: Incorrect!" even if i'm doing exactly what is shown in the solution? MATLAB Onramp
You are plotting code from lines 9 to 14 if the condition *doPlot == 1*, Instead of 5 to 8. Place the if statement beginning fro...

3 years ago | 1

| accepted

Answered
Saving results of a for loop in a cell array
NewCell = cell(1,numel(DataFrame)); %creat an empty cell for the results for iAnimal = 1:numel(DataFrame) %repeat for each...

3 years ago | 1

| accepted

Answered
How to create cp-λ characteristics curve, for different values of the pitch angle β for Wind Turbine block?
c1 = 0.5176; c2 = 116; c3 = 0.4; c4 = 5; c5 = 21; c6 = 0.0068; Beta = linspace(-2,24,10); Lambda = linspace(0,15,20); ...

3 years ago | 1

| accepted

Answered
Why am I getting an error message on my code?
numThrows = 10; numTrials = 30; [estPiAve, estPiStD] = estPiStats(numThrows,numTrials) % provide all input arguments when ca...

3 years ago | 0

Answered
How do I append my answers in an array, while using loop?
z = 6; w = 5; syms x y eqn1 = x + y + z + w == 13; eqn2 = 2*x + 3*y - w == -1; A = [6 5; zeros(10,2)]; % create matri...

3 years ago | 0

| accepted

Answered
When defining an anonymous function, how do I utilize cell indexing of an intermediate function?
Try something like below epsTarray = @(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10) ... expression y = epsTarray(n(1),n(2),n(3),n(4),n(5...

3 years ago | 0

Answered
How can I rectify this error? 'Invalid use of Operator.' 'Too many Output arguements'
%Input % MU_X [n x 1] Expected value of x. % SIGMA_X [n x n] Covariance of x. % A [m x n] Linear...

3 years ago | 0

Answered
Issues plotting simple bar graph.
A = [0.1; 0.4; 1.1; 2.2; 2.5; 0.2; 2.5; 2.2; 1.1; 0.4; 0.1]; B = [25; 20; 15; 10; 5; 0; 5; 10; 15; 20; 25]; bar(A); xti...

3 years ago | 0

| accepted

Answered
The numbers do not appear in standard format despite the writing (format shortG)
Use %f format specifier format shortG Mf=6.480554950317725e+03 Cp_sea=3.976; t_out=100; t_in=25; Qu=Mf*Cp_sea*(t_out-t_...

3 years ago | 0

Answered
what is the meaning of this error? how to stop this error?
If you have function % assuming the below line is not present as per your comments % For context, I am using this as a calli...

3 years ago | 0

Answered
Getting Naan error while integrating with multiple parameters
h=6.63*(10^-34); k=1.381*(10^-23); c=3*(10^8); T=6000; fun = @(x) (2*h*(c.^2)).*(x.^(-5)).*(exp((h.*c)./(k*x*T))-1).^(-1);...

3 years ago | 0

Answered
Error using plot. Data must be numeric, datetime, duration or an array convertible to double.
% syms n A0 = 5/4; An= 0; T = 2; Wo = pi; t=linspace(0,5*T,1000); Arm = 5; hold on for n=1:1:Arm Bn = (5*(-1)^n)/(...

3 years ago | 0

Answered
Multiple subplots having same legend
Read this page https://in.mathworks.com/help/matlab/ref/sgtitle.html

3 years ago | 0

Answered
How to put NaN in certain row of particular column according to another column having NaN in some row
data.Pyrn2_Avg(isnan(data.u_py)) = NaN; % assign NaN to this line

3 years ago | 0

| accepted

Answered
how can i solve this angle between vectors?
a = 3; b = 5; c = 7; alpha = acosd((a.^2 + b.^2 - (c).^2)./(2*a*b))

3 years ago | 0

Answered
What is the problem with the below code?
diff30 = (drugs30 - placebo30)./ placebo30 * 100;

3 years ago | 1

Answered
For loops step through time and update variable
C=100; dL=0.01 L=0:dL:0.2; % size 21 A=zeros(size(L)); B=zeros(size(L)); A(1)=300; % initial value for A ...

3 years ago | 0

Answered
How can i plot the graph from the 3 variables equation ?
A = 0:500:2000; B = 0:1:100; [AA BB] = meshgrid(A,B); X = AA.*(BB+25); surf(AA,BB,X) xlabel A ylabel B zlabel X

3 years ago | 1

| accepted

Answered
Why is my integration output the mathematical expression and not the solution?
func = @(x) ((x.^3.*cos(x./2)+1/2).*(sqrt(4-x.^2))); integral(func,-2,2) If you use *integral* it will work as you expecte...

3 years ago | 0

Load more