Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: about complex number Date: Wed, 1 Feb 2012 17:56:09 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 48 Message-ID: <jgbubp$ft$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: www-02-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1328118969 509 172.30.248.47 (1 Feb 2012 17:56:09 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 1 Feb 2012 17:56:09 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 3262928 Xref: news.mathworks.com comp.soft-sys.matlab:756428 hi, i was sent previously code of my project.I am now correct and got a single drain current value for single Vds and Vgs.But the Ids i.e. drain to source current got a complex value.Some part code with some sequence of execution on command line are given below >> pC = 2.0 * (xg - x_s) + Gf2 * (1.0 - Es + delta_1s * k_ds - delta_nd * (1.0 + xi1s)) pC = 626.6728 >> qC = Gf2 * (1.0 - k_ds) * Ds qC = 2.5516e+005 >> temp = 2.0 - Gf2 * (Es + delta_1s * k_ds - delta_nd * xi2s) temp = 2 >> temp = pC * pC - 2.0 * (temp * qC) temp = -6.2793e+005 >> sq=sqrt(temp) sq = 0 +7.9242e+002i >> x_ds = 2.0 * (qC/sqpc) x_ds = 3.1334e+002 -3.9621e+002i >> In above case pC,qC, temp are not complex number it is (1X1 double), and sq and x_ds achieved was complex number. Now i want a solution is that how a get answer without getting a complex number. What is wrong with such coding actual whole code is more legthy so that i give some line maximum in my code 7 parameter face such problem. plz help me to solve my problem