![photo](/responsive_image/150/150/0/0/0/cache/matlabcentral/profiles/9634036_1522133620756_DEF.jpg)
kingsley
自 2017 起处于活动状态
Followers: 0 Following: 0
Feeds
提问
assign value and plot outside the loop
function [call_value]=different_k(S, r, sigma, t, steps) call_value=zeros(226,1); for i=75:300 call_valu...
6 years 前 | 0 个回答 | 0
0
个回答提问
print out a matrix with a large size
I have a matrix with a large size. How can I print it out as the form showed in the picture. <</matlabcentral/answers/upload...
6 years 前 | 0 个回答 | 0
0
个回答提问
extract data from matrix and store into a new matirx
I want to extract data of row 6 and the last row from the test matrix. Here is my code: test=[1 2;13 12; 3 0; 4 0; 5 3; 30...
6 years 前 | 1 个回答 | 0
1
个回答提问
Question about logical calculation in matrix
I want to sum up the numbers on the 1st column if its corresponding numbers on the 2nd column =1; and if sum up the numbers on t...
7 years 前 | 2 个回答 | 0
2
个回答提问
Convert higher order to first order system
I'm trying to solve the higher order ode by using RK4 method. Here is the code I have so far. function [y] = rk4_high_ode(...
7 years 前 | 1 个回答 | 0
1
个回答提问
trouble of taking derivative of function in newton method
I'm trying to write a code for newton method. But I'm having a trouble of taking the derivative of the function(f(x(i))). Here i...
7 years 前 | 0 个回答 | 0
0
个回答提问
I believed I almost finish the last question of the project. However, there is an error appear on line 5 in my code; " Undefined function or variable 'x' in question 3 of the project. ", I had tried to used x(i), xi or x. But still appears same
function [u]= bvp_robin_finite_difference(n,f,a,b,alpha,beta,gamma,a1,b1,g1,a2,b2,g2) A=zeros(n+1,n+1); ...
7 years 前 | 1 个回答 | 0
1
个回答提问
I created a zeros (n+1 by n+1) matrix. And I want the value 2*i on the row (2 : n)&(column 1:n-1) , where i is from 1 to n-1, how should I get that? Can anyone help me out?
I tried this : n=4; A=zeros(n+1); for i=2:n-1 A([2:n,2:n-1])=[2*i] end But it didnt work
7 years 前 | 2 个回答 | 0
2
个回答提问
I want to create a n by 1 matrix. The FDF2=2 is on the top row, while BDF2=3 is on the bottom. And the values of the middle row should all equal to 3. How do I input the values in such matrix?
Should I create a zeros(n+1,1) matrix first?
7 years 前 | 1 个回答 | 0
1
个回答提问
I'm trying to create a n by n sparse matrix with 3*xi-xi^2 on the main diagonal of K, and with with 6*xi on the sup-diagonal of K , where i starts from 1 to n. And everywhere else 0. Can anyone please tell me how to get that ?
Before I created a matrix that the main diagonal of K are alternatively 2 and -2’s, the sub- and sup-diagonal of K alternatively...
7 years 前 | 1 个回答 | 0
1
个回答提问
Error in SOR function.
I'm trying to create a function that performs the SOR method. Here is the code I have and the test program. When I ran the test ...
7 years 前 | 1 个回答 | 0
1
个回答提问
How to find/present all of the grid points xi, where xi = 2+(i-1)*2 for 0<=i<=n.
I'm trying to figure out how to display the value of from x(0) to x(n)
7 years 前 | 1 个回答 | 0
1
个回答提问
I'm trying to create a function to calculate option price under Black-Scholes model. But it keeps saying that there is a mistake on d1; I double check it, but I can't find a mistake in there. Perhaps there is other thing I'm missing?
function [c,p]=european_formula(id, K, T, S, sigma, q, r) i=id; X=K; t=T; S0=S; v=sigm...
7 years 前 | 1 个回答 | 0
1
个回答提问
how to make the numbers on the matrix with alternative sign?
I want to create a matrix that the main diagonal of K are alternatively 2 and -2’s, the sub- and sup-diagonal of K alternatively...
7 years 前 | 2 个回答 | 0
2
个回答提问
how to make the main diagonal of K are alternatively 2 and -2’s
How to get alternative signs for the numbers on the diagonal of a matrix
7 years 前 | 2 个回答 | 0