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

plus de 3 ans il y a | 1

Réponse apportée
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; ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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) % ...

plus de 3 ans il y a | 0

Réponse apportée
solving non linear equations
fc(:,i+1)=subs(fc,[x;y;z],xn) jc(:,i+1)=subs(jc,[x;y;z],xn)

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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

plus de 3 ans il y a | 1

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

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

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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]) % ...

plus de 3 ans il y a | 0

Réponse apportée
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....

plus de 3 ans il y a | 0

Réponse apportée
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(:...

plus de 3 ans il y a | 0

Réponse apportée
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 ,...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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) ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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)...

plus de 3 ans il y a | 0

Réponse apportée
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 =...

plus de 3 ans il y a | 0

Réponse apportée
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

plus de 3 ans il y a | 0

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

plus de 3 ans il y a | 0

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

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

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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

plus de 3 ans il y a | 0

Réponse apportée
How to store output from for loop to a table
v = 100; g = -10; counter = -1; loops = 19; m = zeros(20,2); while counter <= loops counter = counter + 1; t = co...

plus de 3 ans il y a | 0

| A accepté

Charger plus