PLOTTING OF MITTAG-LEFFLER FUNCTION- AFUNCTION DEFINED IN TERMS OF AN INFINITE SERIES

조회 수: 2 (최근 30일)
Please can someone help me find out what is wrong with the code below: % plotting of the ML function k=0:100; alpha=0.5; t=0:100; ML = sum((t.^alpha*k)/(Gamma(0.5*k + 1))); plot(t, ML)
I AM GETTING AN ERROR MESSAGE:"Error using mtime, inner matrix dimensions must agree.s"
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 11월 17일
Is there exactly one k for each t, or should each t be used with all of the k, thus producing a 101 x 101 matrix (at least temporarily) ?
Chuzymatics Chuzymatics
Chuzymatics Chuzymatics 2013년 11월 17일
Each k is meant to be used with all the t. I've tried the (.*) operation which is element-wise multiplication but the error message was even more embarrassing.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 11월 17일
Your t is a vector and you are requesting that (a power of) it be matrix multipled ("*" operation) with another vector, k. Matrix multiplication requires that the last dimension of the first matrix be the same as the first dimension of the second matrix.
If you want the multiplication to occur element-by-element, then use .* instead of *
Caution: also look at ./ instead of /
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 11월 17일
If each k is meant to be used with all of the t, have a look at ndgrid() as a way of forming all combinations of k and t.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Special Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by