Recent content by mfarooq52003
-
M
Undergrad Calculating Roulette Probability for Multiple Occurrences in Limited Spins
Hi There I wonder if someone can help me with this roulette wheel command. I have to solve a problem in MATLAB using a set of algorithms. If I have two algorithms then I use rand() command to choose one of them randomly but if I have more than two algorithms I need to use this roulette wheel...- mfarooq52003
- Post #11
- Forum: Set Theory, Logic, Probability, Statistics
-
M
MATLAB Evaluating Functions in MATLAB with x,y Range 1-1000
Hi Can anyone help how to write the matrix A=[ 2 1 0 0 0 0 2 1 0 0 1 0 2 1 0 0 1 0 2 1 0 0 1 0 2] I need A with the above pattern of any dimension n and also a vector of the form v=[3 3 4 4 4...- mfarooq52003
- Post #4
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
MATLAB Setting Initial Conditions for ode45() with f(1.5) Known
Hi There I was wondering if anyone knows how to write pentadiagonal matrix of any dimension in Matlab with maindiagoanl 10, super diagonal 3, -3 and lower diagonal 2, -2. Thanks- mfarooq52003
- Post #5
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
Solve Problems in Loops: Get Feedback & Robustness
My algorithms solve a linear system of equation Ax=b using iterative approach. I just want some one, to check the loop bit and see if I have done any thing wrong, if not just tell me. The algorithm has to stop once the residual becomes equal to the epsilon and then we get the solution, otherwise...- mfarooq52003
- Post #14
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
Well, I want it as not equal but we can do it other way as well but then it will be >=. Can you check the step-2, the loop bit only please, if there is any mistake. It runs but I want to share it with experts so that I can go for comparison and analysis after their expert opinion, if it is OK.- mfarooq52003
- Post #12
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
Thank you very much for your guidance, support and help berkeman- mfarooq52003
- Post #9
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
B=gallery('tridiag',10,-6,4,4);n = 10; BL = kron(eye(n),B); [p1,q1] = size(B); BLI = BL - diag(ones(1,n*q1-p1),-p1) - diag(1*ones(1,n*q1-p1),p1); A=BLI...- mfarooq52003
- Post #8
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
Dear Berkeman Can you read it now or should I email you in attachment as M-file. Cheers Farooq- mfarooq52003
- Post #5
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
Thank you very much for such a prompt response. Actually I think my programme is not going through the else part of the algorithm even when the condition is satisfied, I guess. I want to get result from these two algorithms and then do the comparison that which one is better.- mfarooq52003
- Post #4
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
If you can only check the loop part of both the algorithm and see if there is any mistake, if you people don't have enough time for the whole algorithm.- mfarooq52003
- Post #2
- Forum: Programming and Computer Science
-
M
Solve Problems in Loops: Get Feedback & Robustness
Hi There Can anyone check the following algorithm and tell me what I am doing wrong. If every thing is OK then please give me some feedback to make it robust. Please check both the algorithms Algorithm-1 B=gallery('tridiag',10,-6,4,4);n = 10; BL = kron(eye(n),B); [p1,q1] = size(B)...- mfarooq52003
- Thread
- Loops
- Replies: 14
- Forum: Programming and Computer Science
-
M
MATLAB Block diagonal matrices in MATLAB?
[SIZE="5"]Hi Trambolin, Thank you once again for your help and quick response. It worked this time and my matrix A is now block tridiagonal. I just made the following changes according to my matrix structure, BLI = BL - diag(ones(1,n*q-p),-p) - diag(1*ones(1,n*q-p),p); i.e changed the...- mfarooq52003
- Post #9
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
MATLAB Block diagonal matrices in MATLAB?
Hi, Now if I have a tridiagonal matrix B with main diagonal 4, upper diagonal 4 and lower diagonal -6 and I have to creat a matirx A with main diagonal the above matrix B, upper and lower diagonals Identity matrix I of the same dimension B, how we can creat that. My actual problem is writing...- mfarooq52003
- Post #7
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
MATLAB Block diagonal matrices in MATLAB?
Hi trambolin Thank you very much for your help and such a prompt response. Regards Farooq- mfarooq52003
- Post #6
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
M
MATLAB Block diagonal matrices in MATLAB?
Hi, I have to write a block tridiagonal matrix of dimension 100 in MATLAB and I tried every thing but it is not working for me. I have a matrix B of dimension 10 which is tridiagonal and 4 on the main diagonal and super diagonal and -6 on the subdiagonal. From this B I have to develop a...- mfarooq52003
- Post #4
- Forum: MATLAB, Maple, Mathematica, LaTeX