Why is part of the output “Null”?












1














Whenever I execute the code, portions of the output are null. How can I fix this? I am not sure the extent to which the result is invalid because I am not entirely familiar with the null output, though I have read the documentation. The point in which this problem arises is labeled in the following code:



 omega[t_, t0_, T_] = Exp[(-(t - t0)^2)/T^2];
omegap[t_, t0p_, Tp_] = Exp[-((t - t0p)^2)/Tp^2];
eff[t_, t0p_,
Tp_] = ((omega[t, t0, T])^2 - (omegap[t, t0p,
Tp])^2)/(2 [CapitalDelta]);
eff[t_, t0p_,
Tp_] = (omegap[t, t0p, Tp]*omega[t, t0, T])/([CapitalDelta]);
ReducedHam = ({
{[CapitalDelta]eff[t, t0p, Tp], [CapitalOmega]eff[t, t0p, Tp]*
Exp[Sqrt[-1]*[CurlyPhi]]},
{[CapitalOmega]eff[t, t0p, Tp]*
Exp[-Sqrt[-1]*[CurlyPhi]], -[CapitalDelta]eff[t, t0p, Tp]}
});
Print[MatrixForm[ReducedHam]]
[Theta][t_, t0p_, Tp_] = ArcTan[omegap[t, t0p, Tp]/omega[t, t0, T]];
[Lambda]1 = ({
{Cos[[Theta]]},
{-Sin[[Theta]]*Exp[-Sqrt[-1]*[CurlyPhi]]}
});
[Lambda]2 = ({
{Sin[[Theta]]*Exp[Sqrt[-1]*[CurlyPhi]]},
{Cos[[Theta]]}
});
Print[MatrixForm[[Lambda]1]]
Print[MatrixForm[[Lambda]2]]
Mat1 = (D[[Lambda]1, [Theta]]).(Transpose[[Lambda]1]);
Print[Mat1]
V1 = Transpose[[Lambda]1].D[[Lambda]1, [Theta]];
V2 = [Lambda]1.Transpose[[Lambda]1];
Print[MatrixForm[V2]]
Mat2 = V1[[1, 1]] V2;
Print[Mat2]
Dimensions[Mat2];
Mat12 = Mat1 - Mat2;
Print[MatrixForm[Mat12]]
Mat3 = Print[
MatrixForm[D[[Lambda]2, [Theta]].Transpose[[Lambda]2]]];
V3 = Transpose[[Lambda]2].D[[Lambda]2, [Theta]];
V4 = [Lambda]2.Transpose[[Lambda]2];
Print[MatrixForm[V4]]
Mat4 = V3[[1, 1]] V4;
Print[MatrixForm[Mat4]]
Mat34 = Mat3 - Mat4;
CDTerm = Mat12 + Mat34 ;
Print[MatrixForm[Simplify[CDTerm]]]
(*this is where null arises*)
TotalHam = ReducedHam + CDTerm;
Print[MatrixForm[Simplify[TotalHam]]]
Dimensions[ReducedHam]
Dimensions[CDTerm]
[CapitalOmega]a[t_, t0p_,
Tp_] = (2 (((D[omega[t, t0, T], t])*(omegap[t, t0p, Tp])) - ((omega[
t, t0, T]) (D[omegap[t, t0, T], t]))))/((omegap[t, t0,
T])^2 + (omega[t, t0, T]^2))
[Gamma][t_, t0_, T_, [CurlyPhi]_] =
ArcTan[([CapitalOmega]a[t, t0p, Tp])/([CapitalOmega]eff[t, t0p,
Tp])] + [CurlyPhi];
f1[t_, t0_,
T_, [CurlyPhi]_] = (Exp[(Sqrt[-1]*[Gamma][t, t0,
T, [CurlyPhi]])]/2)
f2[t_, t0_, T_, [CurlyPhi]_] =
Exp[(Sqrt[-1]*[Gamma][t, t0, T, [CurlyPhi]])/2]
U = ({
{f1[t, t0, T, [CurlyPhi]], 0},
{0, f2[t, t0, T, [CurlyPhi]]}
})
Mat5 = ConjugateTranspose[U].TotalHam.U;
Print[MatrixForm[Mat5]]
Mat6 = ConjugateTranspose[U].(D[U, t]);
Print[MatrixForm[Mat6]]
HModified = Mat5 - Mat6;
Print[MatrixForm[Simplify[HModified]]]









share|improve this question







New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
    – Lukas Lang
    Dec 28 '18 at 15:33


















1














Whenever I execute the code, portions of the output are null. How can I fix this? I am not sure the extent to which the result is invalid because I am not entirely familiar with the null output, though I have read the documentation. The point in which this problem arises is labeled in the following code:



 omega[t_, t0_, T_] = Exp[(-(t - t0)^2)/T^2];
omegap[t_, t0p_, Tp_] = Exp[-((t - t0p)^2)/Tp^2];
eff[t_, t0p_,
Tp_] = ((omega[t, t0, T])^2 - (omegap[t, t0p,
Tp])^2)/(2 [CapitalDelta]);
eff[t_, t0p_,
Tp_] = (omegap[t, t0p, Tp]*omega[t, t0, T])/([CapitalDelta]);
ReducedHam = ({
{[CapitalDelta]eff[t, t0p, Tp], [CapitalOmega]eff[t, t0p, Tp]*
Exp[Sqrt[-1]*[CurlyPhi]]},
{[CapitalOmega]eff[t, t0p, Tp]*
Exp[-Sqrt[-1]*[CurlyPhi]], -[CapitalDelta]eff[t, t0p, Tp]}
});
Print[MatrixForm[ReducedHam]]
[Theta][t_, t0p_, Tp_] = ArcTan[omegap[t, t0p, Tp]/omega[t, t0, T]];
[Lambda]1 = ({
{Cos[[Theta]]},
{-Sin[[Theta]]*Exp[-Sqrt[-1]*[CurlyPhi]]}
});
[Lambda]2 = ({
{Sin[[Theta]]*Exp[Sqrt[-1]*[CurlyPhi]]},
{Cos[[Theta]]}
});
Print[MatrixForm[[Lambda]1]]
Print[MatrixForm[[Lambda]2]]
Mat1 = (D[[Lambda]1, [Theta]]).(Transpose[[Lambda]1]);
Print[Mat1]
V1 = Transpose[[Lambda]1].D[[Lambda]1, [Theta]];
V2 = [Lambda]1.Transpose[[Lambda]1];
Print[MatrixForm[V2]]
Mat2 = V1[[1, 1]] V2;
Print[Mat2]
Dimensions[Mat2];
Mat12 = Mat1 - Mat2;
Print[MatrixForm[Mat12]]
Mat3 = Print[
MatrixForm[D[[Lambda]2, [Theta]].Transpose[[Lambda]2]]];
V3 = Transpose[[Lambda]2].D[[Lambda]2, [Theta]];
V4 = [Lambda]2.Transpose[[Lambda]2];
Print[MatrixForm[V4]]
Mat4 = V3[[1, 1]] V4;
Print[MatrixForm[Mat4]]
Mat34 = Mat3 - Mat4;
CDTerm = Mat12 + Mat34 ;
Print[MatrixForm[Simplify[CDTerm]]]
(*this is where null arises*)
TotalHam = ReducedHam + CDTerm;
Print[MatrixForm[Simplify[TotalHam]]]
Dimensions[ReducedHam]
Dimensions[CDTerm]
[CapitalOmega]a[t_, t0p_,
Tp_] = (2 (((D[omega[t, t0, T], t])*(omegap[t, t0p, Tp])) - ((omega[
t, t0, T]) (D[omegap[t, t0, T], t]))))/((omegap[t, t0,
T])^2 + (omega[t, t0, T]^2))
[Gamma][t_, t0_, T_, [CurlyPhi]_] =
ArcTan[([CapitalOmega]a[t, t0p, Tp])/([CapitalOmega]eff[t, t0p,
Tp])] + [CurlyPhi];
f1[t_, t0_,
T_, [CurlyPhi]_] = (Exp[(Sqrt[-1]*[Gamma][t, t0,
T, [CurlyPhi]])]/2)
f2[t_, t0_, T_, [CurlyPhi]_] =
Exp[(Sqrt[-1]*[Gamma][t, t0, T, [CurlyPhi]])/2]
U = ({
{f1[t, t0, T, [CurlyPhi]], 0},
{0, f2[t, t0, T, [CurlyPhi]]}
})
Mat5 = ConjugateTranspose[U].TotalHam.U;
Print[MatrixForm[Mat5]]
Mat6 = ConjugateTranspose[U].(D[U, t]);
Print[MatrixForm[Mat6]]
HModified = Mat5 - Mat6;
Print[MatrixForm[Simplify[HModified]]]









share|improve this question







New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
    – Lukas Lang
    Dec 28 '18 at 15:33
















1












1








1







Whenever I execute the code, portions of the output are null. How can I fix this? I am not sure the extent to which the result is invalid because I am not entirely familiar with the null output, though I have read the documentation. The point in which this problem arises is labeled in the following code:



 omega[t_, t0_, T_] = Exp[(-(t - t0)^2)/T^2];
omegap[t_, t0p_, Tp_] = Exp[-((t - t0p)^2)/Tp^2];
eff[t_, t0p_,
Tp_] = ((omega[t, t0, T])^2 - (omegap[t, t0p,
Tp])^2)/(2 [CapitalDelta]);
eff[t_, t0p_,
Tp_] = (omegap[t, t0p, Tp]*omega[t, t0, T])/([CapitalDelta]);
ReducedHam = ({
{[CapitalDelta]eff[t, t0p, Tp], [CapitalOmega]eff[t, t0p, Tp]*
Exp[Sqrt[-1]*[CurlyPhi]]},
{[CapitalOmega]eff[t, t0p, Tp]*
Exp[-Sqrt[-1]*[CurlyPhi]], -[CapitalDelta]eff[t, t0p, Tp]}
});
Print[MatrixForm[ReducedHam]]
[Theta][t_, t0p_, Tp_] = ArcTan[omegap[t, t0p, Tp]/omega[t, t0, T]];
[Lambda]1 = ({
{Cos[[Theta]]},
{-Sin[[Theta]]*Exp[-Sqrt[-1]*[CurlyPhi]]}
});
[Lambda]2 = ({
{Sin[[Theta]]*Exp[Sqrt[-1]*[CurlyPhi]]},
{Cos[[Theta]]}
});
Print[MatrixForm[[Lambda]1]]
Print[MatrixForm[[Lambda]2]]
Mat1 = (D[[Lambda]1, [Theta]]).(Transpose[[Lambda]1]);
Print[Mat1]
V1 = Transpose[[Lambda]1].D[[Lambda]1, [Theta]];
V2 = [Lambda]1.Transpose[[Lambda]1];
Print[MatrixForm[V2]]
Mat2 = V1[[1, 1]] V2;
Print[Mat2]
Dimensions[Mat2];
Mat12 = Mat1 - Mat2;
Print[MatrixForm[Mat12]]
Mat3 = Print[
MatrixForm[D[[Lambda]2, [Theta]].Transpose[[Lambda]2]]];
V3 = Transpose[[Lambda]2].D[[Lambda]2, [Theta]];
V4 = [Lambda]2.Transpose[[Lambda]2];
Print[MatrixForm[V4]]
Mat4 = V3[[1, 1]] V4;
Print[MatrixForm[Mat4]]
Mat34 = Mat3 - Mat4;
CDTerm = Mat12 + Mat34 ;
Print[MatrixForm[Simplify[CDTerm]]]
(*this is where null arises*)
TotalHam = ReducedHam + CDTerm;
Print[MatrixForm[Simplify[TotalHam]]]
Dimensions[ReducedHam]
Dimensions[CDTerm]
[CapitalOmega]a[t_, t0p_,
Tp_] = (2 (((D[omega[t, t0, T], t])*(omegap[t, t0p, Tp])) - ((omega[
t, t0, T]) (D[omegap[t, t0, T], t]))))/((omegap[t, t0,
T])^2 + (omega[t, t0, T]^2))
[Gamma][t_, t0_, T_, [CurlyPhi]_] =
ArcTan[([CapitalOmega]a[t, t0p, Tp])/([CapitalOmega]eff[t, t0p,
Tp])] + [CurlyPhi];
f1[t_, t0_,
T_, [CurlyPhi]_] = (Exp[(Sqrt[-1]*[Gamma][t, t0,
T, [CurlyPhi]])]/2)
f2[t_, t0_, T_, [CurlyPhi]_] =
Exp[(Sqrt[-1]*[Gamma][t, t0, T, [CurlyPhi]])/2]
U = ({
{f1[t, t0, T, [CurlyPhi]], 0},
{0, f2[t, t0, T, [CurlyPhi]]}
})
Mat5 = ConjugateTranspose[U].TotalHam.U;
Print[MatrixForm[Mat5]]
Mat6 = ConjugateTranspose[U].(D[U, t]);
Print[MatrixForm[Mat6]]
HModified = Mat5 - Mat6;
Print[MatrixForm[Simplify[HModified]]]









share|improve this question







New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Whenever I execute the code, portions of the output are null. How can I fix this? I am not sure the extent to which the result is invalid because I am not entirely familiar with the null output, though I have read the documentation. The point in which this problem arises is labeled in the following code:



 omega[t_, t0_, T_] = Exp[(-(t - t0)^2)/T^2];
omegap[t_, t0p_, Tp_] = Exp[-((t - t0p)^2)/Tp^2];
eff[t_, t0p_,
Tp_] = ((omega[t, t0, T])^2 - (omegap[t, t0p,
Tp])^2)/(2 [CapitalDelta]);
eff[t_, t0p_,
Tp_] = (omegap[t, t0p, Tp]*omega[t, t0, T])/([CapitalDelta]);
ReducedHam = ({
{[CapitalDelta]eff[t, t0p, Tp], [CapitalOmega]eff[t, t0p, Tp]*
Exp[Sqrt[-1]*[CurlyPhi]]},
{[CapitalOmega]eff[t, t0p, Tp]*
Exp[-Sqrt[-1]*[CurlyPhi]], -[CapitalDelta]eff[t, t0p, Tp]}
});
Print[MatrixForm[ReducedHam]]
[Theta][t_, t0p_, Tp_] = ArcTan[omegap[t, t0p, Tp]/omega[t, t0, T]];
[Lambda]1 = ({
{Cos[[Theta]]},
{-Sin[[Theta]]*Exp[-Sqrt[-1]*[CurlyPhi]]}
});
[Lambda]2 = ({
{Sin[[Theta]]*Exp[Sqrt[-1]*[CurlyPhi]]},
{Cos[[Theta]]}
});
Print[MatrixForm[[Lambda]1]]
Print[MatrixForm[[Lambda]2]]
Mat1 = (D[[Lambda]1, [Theta]]).(Transpose[[Lambda]1]);
Print[Mat1]
V1 = Transpose[[Lambda]1].D[[Lambda]1, [Theta]];
V2 = [Lambda]1.Transpose[[Lambda]1];
Print[MatrixForm[V2]]
Mat2 = V1[[1, 1]] V2;
Print[Mat2]
Dimensions[Mat2];
Mat12 = Mat1 - Mat2;
Print[MatrixForm[Mat12]]
Mat3 = Print[
MatrixForm[D[[Lambda]2, [Theta]].Transpose[[Lambda]2]]];
V3 = Transpose[[Lambda]2].D[[Lambda]2, [Theta]];
V4 = [Lambda]2.Transpose[[Lambda]2];
Print[MatrixForm[V4]]
Mat4 = V3[[1, 1]] V4;
Print[MatrixForm[Mat4]]
Mat34 = Mat3 - Mat4;
CDTerm = Mat12 + Mat34 ;
Print[MatrixForm[Simplify[CDTerm]]]
(*this is where null arises*)
TotalHam = ReducedHam + CDTerm;
Print[MatrixForm[Simplify[TotalHam]]]
Dimensions[ReducedHam]
Dimensions[CDTerm]
[CapitalOmega]a[t_, t0p_,
Tp_] = (2 (((D[omega[t, t0, T], t])*(omegap[t, t0p, Tp])) - ((omega[
t, t0, T]) (D[omegap[t, t0, T], t]))))/((omegap[t, t0,
T])^2 + (omega[t, t0, T]^2))
[Gamma][t_, t0_, T_, [CurlyPhi]_] =
ArcTan[([CapitalOmega]a[t, t0p, Tp])/([CapitalOmega]eff[t, t0p,
Tp])] + [CurlyPhi];
f1[t_, t0_,
T_, [CurlyPhi]_] = (Exp[(Sqrt[-1]*[Gamma][t, t0,
T, [CurlyPhi]])]/2)
f2[t_, t0_, T_, [CurlyPhi]_] =
Exp[(Sqrt[-1]*[Gamma][t, t0, T, [CurlyPhi]])/2]
U = ({
{f1[t, t0, T, [CurlyPhi]], 0},
{0, f2[t, t0, T, [CurlyPhi]]}
})
Mat5 = ConjugateTranspose[U].TotalHam.U;
Print[MatrixForm[Mat5]]
Mat6 = ConjugateTranspose[U].(D[U, t]);
Print[MatrixForm[Mat6]]
HModified = Mat5 - Mat6;
Print[MatrixForm[Simplify[HModified]]]






matrix error output






share|improve this question







New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 28 '18 at 15:15









khaylablack

111




111




New contributor




khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






khaylablack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
    – Lukas Lang
    Dec 28 '18 at 15:33




















  • Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
    – Lukas Lang
    Dec 28 '18 at 15:33


















Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
– Lukas Lang
Dec 28 '18 at 15:33






Mat3 is Null, since Print[…] always returns Null. You might be interested in Echo, which always returns its argument. For the next time, try to look at the different values of the expression that contains Null - this way, you can easily trace the error back to its origin (the Mat3=Print[…] line in this case). For this, Echo is your friend, as you can just put it in front of anything you want to look at
– Lukas Lang
Dec 28 '18 at 15:33












1 Answer
1






active

oldest

votes


















2














Just leave out the Print functions, and remember not to throw away the results with ;. Example:



m1 = IdentityMatrix[3];
MatrixForm[m1]
m2 = 3 m1;
MatrixForm[m2]


enter image description here
Most experienced Mathematica users rarely use Print. To show results, just evaluate them.



A more compact, functional form is:



MatrixForm[m1 = IdentityMatrix[3]]
MatrixForm[m2 = 3 m1]


Same output as above.






share|improve this answer























    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "387"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    khaylablack is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f188500%2fwhy-is-part-of-the-output-null%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Just leave out the Print functions, and remember not to throw away the results with ;. Example:



    m1 = IdentityMatrix[3];
    MatrixForm[m1]
    m2 = 3 m1;
    MatrixForm[m2]


    enter image description here
    Most experienced Mathematica users rarely use Print. To show results, just evaluate them.



    A more compact, functional form is:



    MatrixForm[m1 = IdentityMatrix[3]]
    MatrixForm[m2 = 3 m1]


    Same output as above.






    share|improve this answer




























      2














      Just leave out the Print functions, and remember not to throw away the results with ;. Example:



      m1 = IdentityMatrix[3];
      MatrixForm[m1]
      m2 = 3 m1;
      MatrixForm[m2]


      enter image description here
      Most experienced Mathematica users rarely use Print. To show results, just evaluate them.



      A more compact, functional form is:



      MatrixForm[m1 = IdentityMatrix[3]]
      MatrixForm[m2 = 3 m1]


      Same output as above.






      share|improve this answer


























        2












        2








        2






        Just leave out the Print functions, and remember not to throw away the results with ;. Example:



        m1 = IdentityMatrix[3];
        MatrixForm[m1]
        m2 = 3 m1;
        MatrixForm[m2]


        enter image description here
        Most experienced Mathematica users rarely use Print. To show results, just evaluate them.



        A more compact, functional form is:



        MatrixForm[m1 = IdentityMatrix[3]]
        MatrixForm[m2 = 3 m1]


        Same output as above.






        share|improve this answer














        Just leave out the Print functions, and remember not to throw away the results with ;. Example:



        m1 = IdentityMatrix[3];
        MatrixForm[m1]
        m2 = 3 m1;
        MatrixForm[m2]


        enter image description here
        Most experienced Mathematica users rarely use Print. To show results, just evaluate them.



        A more compact, functional form is:



        MatrixForm[m1 = IdentityMatrix[3]]
        MatrixForm[m2 = 3 m1]


        Same output as above.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 28 '18 at 16:45

























        answered Dec 28 '18 at 16:20









        John Doty

        6,6341924




        6,6341924






















            khaylablack is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            khaylablack is a new contributor. Be nice, and check out our Code of Conduct.













            khaylablack is a new contributor. Be nice, and check out our Code of Conduct.












            khaylablack is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Mathematica Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f188500%2fwhy-is-part-of-the-output-null%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Сан-Квентин

            Алькесар

            Josef Freinademetz