I have two notebooks; one of them is the main notebook which will call the second notebook several times in a loop and inside this loop, matrix called as ALLB, defined in the main notebook, will get the results of the sub notebook's matrix LB[[1,t]].

The problem is matrix ALLB contains the results of the last sub notebook evaluation. For example I have a loop inside the main notebook calculating two times

  For[ni = 4, ni < 6, ni++,

  i = ni - 1; 

  nbLB = NotebookOpen[ToFileName[docpath, "Local_B_spline_Basis.nb"]];

  SelectionMove[nbLB, All, Notebook];


  For[t = 1, t < p + 2, t++,

    ALLB[[ni, t]] = LB[[1, t]];


I find that ALLB[[4,:]]=ALLB[[5,:]] but they must be different. Because in the begining of the loop, my variable "i" changes and then by calling the subnotebook here named as nbLB, its calculations are dependent on the variable i and it must return different LB[[1,t]] matrices and then assigning this different matrices to the ALLB matrix ; ALLB[[4,:]] =! ALLB[[5,:]] I have to find them different but I unfortunately find them exactly the same.

Where do I make a mistake, please help ?

Best Regards;

Dr. Ahmet Hasim

  • $\begingroup$ What is the value of p? What do you mean by e.g. [[4, :]] in your code examples? $\endgroup$ – MarcoB Jun 21 '16 at 13:24
  • $\begingroup$ Hi MarcoB; p is just a variable defined before lets say p = 2. [[4, :]] means I find all the columns for the fourth row of the matrix ALLB is equal to the fifth row. But they must be different. $\endgroup$ – ahmethasim Jun 21 '16 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.