# kingsley

**Statistics**

**MATLAB Answers**

**15** Questions

**0** Answers

RANK**258,792**

of 270,768

REPUTATION**0**

CONTRIBUTIONS

**15** Questions

**0** Answers

ANSWER ACCEPTANCE **
46.67%
**

VOTES RECEIVED**0**

RANK

of 18,282

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

RANK

of 119,617

CONTRIBUTIONS

**0** Problems

**0** Solutions

SCORE**0**

NUMBER OF BADGES**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Question

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...

4 years ago | 0 answers | 0

### 0

answersQuestion

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...

5 years ago | 0 answers | 0

### 0

answersQuestion

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...

5 years ago | 1 answer | 0

### 1

answerQuestion

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...

5 years ago | 2 answers | 0

### 2

answersQuestion

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(...

5 years ago | 1 answer | 0

### 1

answerQuestion

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...

5 years ago | 0 answers | 0

### 0

answersQuestion

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); ...

5 years ago | 1 answer | 0

### 1

answerQuestion

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

5 years ago | 2 answers | 0

### 2

answersQuestion

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?

5 years ago | 1 answer | 0

### 1

answerQuestion

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...

5 years ago | 1 answer | 0

### 1

answerQuestion

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 ...

5 years ago | 1 answer | 0

### 1

answerQuestion

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)

5 years ago | 1 answer | 0

### 1

answerQuestion

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...

5 years ago | 1 answer | 0

### 1

answerQuestion

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...

6 years ago | 0 answers | 0

### 0

answersQuestion

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

6 years ago | 2 answers | 0