Beantwortet
Why is there extra data in my graph?
x =fig.eventsTOP.Event_Type; y = fig.eventsTOP.GroupCount; % bar(x,y)

mehr als 3 Jahre vor | 0

Beantwortet
How to remove a value from a vector in a for loop?
K = setdiff(randi([1 N]),[k]);

mehr als 3 Jahre vor | 1

Beantwortet
how to find out that the length is odd or even
R = 0:0.1:9.1; % example with n = length(R) while 1 % will check the values from 1 to n Nodd = (-1)^n; ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Index exceeds the number of array elements. Index must not exceed 1 error
This function is not returning all Ten variables as defined by fucntion output [TS1,TS2,TS3,TA1,TA2,TA3,H1,H2,H3,area] func...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do I fix the particular error code that I was given for my code?
generateReport(allHurricaneData) % are you calling structure in this way in main script or generateReport(HurricaneData) % ...

mehr als 3 Jahre vor | 0

Beantwortet
solving non linear equations
fc(:,i+1)=subs(fc,[x;y;z],xn) jc(:,i+1)=subs(jc,[x;y;z],xn)

mehr als 3 Jahre vor | 0

Beantwortet
How to put a variable in a legend without it being in the range of the plot?
slope = 3; x = 1:5; y = 6:10; a = 11:15; b = 16:20; slopestr = sprintf('slope is %f',slope) figure(1); plot(x,y); hold o...

mehr als 3 Jahre vor | 0

Beantwortet
Partial derivative with respect to x^2
syms x y z t f= (x^5*y^3+ z^2*x^2+y*x) / (x^3*y+x*y) % t = x^2 % assume x = sqrt(t) F = subs(f,x,sqrt(t)) y = diff(F,t) Y...

mehr als 3 Jahre vor | 0

Beantwortet
access nested struct from excel to matlab
myStruct.d = rand(1,10); % struct with data Par1 = {myStruct}; % nested in cell Data = Par1{1}.d % access data

mehr als 3 Jahre vor | 1

Beantwortet
Output of one table as a value into a new table
TableB.group(j-1,:) = sum(TableA.group(j)); As the error states use *table* as above instead of array

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
user function and plot
May be this change, with regards to returning output variables x1 and x2 since function is not returning both variables as writt...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Plot temperature Mean vs time
Use the . symbol to access the variables and markers since you are plotting scalars in the for loop plot(dataStruct.Mean,dataSt...

mehr als 3 Jahre vor | 0

Beantwortet
error: Unable to perform assignment because the size of the left side is 1-by-49 and the size of the right side is 1-by-51 at line 23, where is the problem?
T(Nx,2:Ny-1) = TR(2:Ny-1); T(2:Nx-1,1) = TB(2:Nx-1).'; Vectors TR and TB are of different sizes

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
The stem plot is not shown in the figure
t = 0:0.01:2; % sample points from 0 to 2 in steps of 0.01 xt = sin(2*pi*t); % Evaluate sin(2 pi t) subplot(2,1,1); % Two r...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting 2 arrays as bar charts with adjacent bars
A = rand(1,8); B = rand(1,8); bar([1 2 3 4 5 6 7 8],[A;B]); % use concatenation

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to use a variable from one for loop in another for loop?
R = [ElmtCentre(:,i);0];

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
plot with two y axis matlab - same axis at 0
yyaxis left plot(Time,LimitedVoltage,'LineWidth',3.0) ylabel("Voltage [V]","FontSize",30,"FontName","Times") ylim([0 10]) % ...

mehr als 3 Jahre vor | 0

Beantwortet
How to fix error using horzcat when trying to display?
try with sprintf a = [-3.821; 0.135; 5.995; -5.557; -4.041; -3.094; -3.244; -3.074; -1.241; -4.216; -2.834; -0.424; 5.337; -0....

mehr als 3 Jahre vor | 0

Beantwortet
How to mean data of second column with respect to the similar element in the first column
This is one approach D(:,1) = [zeros(6,1); ones(6,1)*0.01667; ones(6,1)*0.05]; D(:,2) = rand(length(D),1); o = unique(D(:...

mehr als 3 Jahre vor | 0

Beantwortet
Index in position 1 exceeds array bounds. Index must not exceed 1.
% intializing the constants m = 20; k = 20; x0 = 1; v0 = 0; t_span = (0:.1:15) initalCon = [t_span(1) , x0 , v0]; % Time ,...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
plot a uniform flow
[x,y] = meshgrid(0:0.1:5,0:0.1:5); alpha =10; U=1; startx = 0.1:0.1:5; starty = ones(size(startx)); for i =1:length(x) ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting a given function over an interval
syms x y1 = (x.^5) - (6.13*x.^2) - (0.83*x) - (0.62 ./ (x.^2 + 0.0825)) + 5.2; fplot(y1,[-1.5 1.5]) % range of values

mehr als 3 Jahre vor | 0

Beantwortet
I have plotted the stress strain graph from the tensile experiment and now I want to find the young's modulus of elasticity,yield point and yield stress
T=readmatrix('tensile1_270_23.txt'); D=T(:,1); F=T(:,2)*1000; B=25; A=(12.6*4.1); strain=(D/B)+3.1710e-05; stress=F/A+1.78...

mehr als 3 Jahre vor | 0

Beantwortet
unable to proceed multiplication of vectors and also use for loop
clc; clear; close all; % hermite matrix H = [2 -2 1 1;-3 3 -2 -1;0 0 1 0;1 0 0 0] % hermite segment between A(0,0) and B(1,2)...

mehr als 3 Jahre vor | 0

Beantwortet
Relation between depths and thicknesses
syms z1 z2 z3 z4 z5 t = [31 27 52 268]; % known thicknesses eq1 = z1; eq2 = z2 == z1 + t(1); eq3 = z3 == z2 + t(2); eq4 =...

mehr als 3 Jahre vor | 0

Beantwortet
how can I do subtraction between two symbolic functions with different arguments?
syms X(alpha,beta) syms Y(theta) eqn = X(alpha,beta)-Y(theta) % define symvars for X and Y

mehr als 3 Jahre vor | 0

Beantwortet
Help with Legend for Plot
clc; % Clear the command window. close all; filename = 'amplitudeT1cleaned.xlsx'; data = readtable(filename); VN =...

mehr als 3 Jahre vor | 0

Beantwortet
i am trying to run my code with different L values, which changes the k values running them through the same function, generating Omega 1,2,3 for each L which I can plot .
keq=(3*E*Im)./(L.^3); You can use element wise division for all values of L

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
how to Insert cell array into a cell?
%INPUT A = {'one''two''three'}; B = {A,'four''five''six'};

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
I’m trying to find the resultant matrix z=R^-1*S but it keeps saying “array indices must be positive integers… how can I solve it?
R= [1 0 0 4 1; 2 -2 0 1 -1; 0 4 1 -3 0; 1 -1 2 2 1; 3 2 5 0 1]; S= [11;-7;3;-17;5]; Z=inv(R).*S

mehr als 3 Jahre vor | 0

Mehr laden