統計
All
Feeds
質問
I'm making a Gaussian Elimination function that can switch rows to allow the function to work on any matrix. The function works other than the row switching part. I'm not sure why that portion of my code isn't working.
function [x, red_A] = GEPivor(A, b) %Checking that b is a column vector if isrow(b) b=b'; else b=b;...
10年弱 前 | 0 件の回答 | 0
0
回答質問
I have to make a code that does matrix multiplication. This is what I have so far but I'm not sure why it's not working. I cannot figure out if my for loops for k, i, and j are correct.
function [C] = mult(A, B) [n1,m1]=size(A); [n2,m2]=size(B); if m1~=n2 error('Matrix dimensions do not match');...
10年弱 前 | 1 件の回答 | 0
1
回答質問
Use a Taylor series to write a function that approximates f(x)=sin(x) for any x with a max error=1e-3. It should behave just like MATLAB’s function for sin(x). Use the built-in mod function to allow for any value of x to account for periodicity.
This is what I have so far. I don't know how to incorporate mod into this function and how to not use the sin(x) function in it ...
10年弱 前 | 1 件の回答 | 0
1
回答質問
Write a function [M] = myMax(A), where M is the maximum value in an array A. Don't use the built-in MATLAB function max. Then write a function (M) = myNMax(A,N) where M is an array consisting of the N largest elements in A using the myMax function.
My myMax function looks like this: function [M] = myMax(A) for i=1:(length(A)-1) M=A(i); if A(...
10年弱 前 | 2 件の回答 | 0
2
回答質問
Expand the following code: The first line of code is required to initialize the array of which further calculations can be made.
Expand the following: B = randi([-10 10], [1 6]); C = B(B<0); So far I have but it keeps getting an error ...
10年弱 前 | 1 件の回答 | 0
1
回答質問
Write a function called “makemat” that will receive two row vectors as input arguments, and from them create and return a matrix with two rows. You may not assume that the length of the vectors is known. Also, the vectors may be of different lengths.
So far I have this but it's not working when the two vectors are different lengths: function [C] = makemat(A, B) if ...
10年弱 前 | 1 件の回答 | 0
1
回答質問
I need to find the minimum at what radius is the surface area smallest (use the “min” function in MATLAB, see MATLAB help for proper syntax of the min function) but I just can't get it to work.
So far I have: V=10 A=@(r)(pi*r.*sqrt(r.^2+((9*V.^2)./(pi.^2*r.^4)))) r=0:10; plot(r,A(r)); [m,i]=min(A) And...
10年弱 前 | 2 件の回答 | 0
2
回答解決済み
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...
約10年 前


