The program runs infinite times, initially matrix A is a 3*3 matrix with all 0s. B is 3 * 3 matrix with all ones and so is C.
The loop condition evaluates to 0 + 0 +0 <= 1+1+1 that is, 0<=3 which is true for the first time, again in the whole iteration of finding values C no updation is made to values in matrix A and B, the loop runs infinite times.
If the outer while loop is eliminated, the for loop runs for 1 to 3 .
Working is shown below, as it recalculates value for C(rr,cc) and C(cc,rr) few values remain 2 which are C(2,1), C(3,1) and C(3,2)
The programed used is Matlab but i want the answer by hand without Matlab
Rens Courses LMS Integration Documentation SP20 - EE202 - Seco3 - HWS > HW Assignment 6 > & HW6 - Problem 3 - Chapter 6 Problem 26 1 solution submitted (max: 3) View my solutions Chapter 6 Problem 26 Write a MATLAB program in a script file that finds a positive integer n such that the sum of all integers 1+ 2+ 3+ ... +n is a number between 100 and 1000 whose three digits are identical. As output, the...
MATLAB
I need Matlab ouput
4. Solve the following linear set of equations using the script given below. 53 1 1] x) A=1 3 1 X=(x₂ , B={10} [1 1 3] (45) x=zeros(3,1); AB=[A B] n=size(A,1); for i=1:n-1 P=-(AB(+1:end,i)/AB(1,1)) AB(i+1:end,i:end)=AB(i+1:end,i:end)+P*AB(i,i:end) end for i=n:-1:1 x(1,:)-(AB(i,n+1:end)-AB(1,i+1:n)*x(i+1:n:)YAB(1,1) end
Please follow the directions and show steps.
A2 use MATLAB, write down the MATLAB command you used. a. For the matrix A3 -4 7calculate the norm | 2 4 -1 8 0-1 b. For the matrix B0 0 4 calculate the norm | Bl22 by hand. Even the eigenvalues of BTB have to be calculated on paper without MATLAB and without using determinants!
A2 use MATLAB, write down the MATLAB command you used. a. For the matrix A3 -4 7calculate...
Question 1
QUESTION 2
Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...
Write Matlab Determine the constant of array A after the following statement are executed A=[4 7 3; 9 12 6; 7 6 9] i. A([1,3],:)=A([2],:) ii. C=eye(3,3) b=[1 2 3] C(2,:)=b
this is the function in matlab function [yint] = Newtint(x, y, xx) n= length(x); if length(y) ~=n , error('x and y must be same length'); end b= zeros(n,n); b(:,1) = y(:); %{ b(1,2)=b(2,1)-b(1,1)/x(2)-x(1) %} for j= 2:n for i= 1:n-j+1 b(i, j) = (b (i+1, j-1)-b(i, j-1))/(x(i+j-1)-x(i)); end end xt = 1; yint = b (1,1); for j = 1:n-1 xt = xt* (xx-x(j)); yint = yint+b(1, j+1) *xt; end end this is the input: >> x...
2 Problem 3 (25 points) Let I = ïrdz. a) [by hand] Use a composite trapezoidal rule to evaluate 1 using N = 3 subintervals. b) MATLAB] Use a composite trapezoidal rule to evaluate I using N - 6 subinterval:s c) by hand] Use Romberg extrapolation to combine your results from a) and b) and obtain an improved approximation (you may want to compare with a numerical approximation of the exact value of the integral
2 Problem 3 (25 points)...
I want to see the work written out because I do not understand
how a for loop works without running it on MatLab
Exercise 13 (2 pts.): Predict the output that appears in Matlab's command window when the following Matlab program is run (REMEMBER to SHOW SOME WORK!) clear;clc a = 3; c=2; d = zeros (1,5) -2; for m - 1:5 x = (m-1)"c; y = (-1)^n; z=x-y; d(m) = z + 1; end
10. TRUE or FALSE: Write TRUE if the statement is always true; otherwise, write FALSE. _a. {0} c{{0}, {{0}}} _b. Ø $ ({1, 2}), the power set of {1,2} c. If5<3 then 8 is an odd integer. d. The relation R = {(a,b), (b,a)} is symmetric but not transitive on the set X = {a,b}. e. The relation {(1,2), (2,2)} is a function from A={1,2} to B={1,2,3} _f. If the equivalence relation R = {(1,1), (2,2), (3,3), (4,4), (1,3), (3,1),...
3. Refer to the following table for data for the thickness of a deposition. (Do this by hand and by MATLAB). Factor A is the flow rate of arsenic while Factor B is the deposition time. There are four replicates per combination. Replicate Factor Levels IV Low High + 5590 59% 14.037 16.16513.972 13.907 13.88 13.86 14.032 13.914 10min 15min 14.821 14.757 14.843 14.878 14.888 14.92 14.41514.932 Estimate the factor effects a. b. Conduct an analysis of variance. Which factors...