<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Matlab Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'Matlab' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Fri, 20 Nov 2009 20:25:49 -0700</pubDate>
    <lastBuildDate>Fri, 20 Nov 2009 20:25:49 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>MATLAB GUI</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409617/409617/matlab-gui/</link>
      <description>Hi guys,&lt;br /&gt;
        Iam working to create a GUI using matlab. my program is being executed well iam getting output. but the thing is that when i want to plot the data using a GUI its giving problem. So can anyone help me out with this problem&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409617/409617/matlab-gui/</guid>
      <pubDate>Thu, 19 Nov 2009 22:06:09 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Subscripted assignment dimension mismatch</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409522/409522/subscripted-assignment-dimension-mismatch/</link>
      <description>Hi Everyone &lt;br /&gt;
&lt;br /&gt;
I have stored a few values in a structure. I am using the getfield() &lt;br /&gt;
function and after getting value of a single element which satisfies a &lt;br /&gt;
condition storing it in a variable varx &lt;br /&gt;
&lt;br /&gt;
The situation is like this: &lt;br /&gt;
for i=1:4 &lt;br /&gt;
for n=1:4 &lt;br /&gt;
varx(i,:) = getfield(J,{n,1}, 'val') &lt;br /&gt;
end &lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
The 'val' field of the structure has values in the form &lt;br /&gt;
j1,j2,......j15. J is the name of the structure. &lt;br /&gt;
I have no problem if the 'val' field has values upto 'j9'. &lt;br /&gt;
But when the selected value is in the range j10,.....j15 &lt;br /&gt;
i get the following error: &lt;br /&gt;
??? Subscripted assignment dimension mismatch. &lt;br /&gt;
&lt;br /&gt;
Any help in this regard is highly appreciated. &lt;br /&gt;
Regards &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409522/409522/subscripted-assignment-dimension-mismatch/</guid>
      <pubDate>Wed, 18 Nov 2009 06:45:50 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>SVD inconsistency</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409474/409474/svd-inconsistency/</link>
      <description>Cannot figure out why the Matrix S1 and S2 differ. Seems to work when the Matrix S1 is a random matrix (rand) but when the source is a wave file which has been made into a matrix using the Short time Fourier transform S! and S2 differ and  i cannot seems to get back the original matrix S1. Anybody has any clue Why this happens? &lt;br /&gt;
&lt;br /&gt;
y = wavread('source.wav');&lt;br /&gt;
S1= myspectrogram(y);       % Generic routine to get the STFT&lt;br /&gt;
[U S V]=svd(S1);&lt;br /&gt;
S2= U*S*(V');&lt;br /&gt;
&lt;br /&gt;
If anybody has any clue plz reply. Thanks for looking.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409474/409474/svd-inconsistency/</guid>
      <pubDate>Tue, 17 Nov 2009 19:54:00 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Help generare grafic</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409468/409468/help-generare-grafic/</link>
      <description>As avea nevoie de ajutor referitor la realizarea unui grafic in matlab. Va atasez graficul si cerintele sunt urmatoarele:&lt;br /&gt;
   Semnalul modulator va fi situat în banda . 0,1-1khz               . şi va avea spectrul de forma din figura. Frecvenţa de eşantionare, Fs, va fi de. 50khz. Frecvenţa purtătoarei va fi de 0,1*Fs. Perioada de timp în care se prelevează eşantioane va fi aleasă astfel încât sa cuprindă minim 2 perioade din fiecare componentă spectrală a semnalului modulator.Ideea e ca se porneste de la un fisier pe care vi-l scriu mai jos.As fi recunoscatoare daca ar stii careva cum pot sa obtin graficul ,pornind de la fisier. Va multumesc mult:)&lt;br /&gt;
&lt;br /&gt;
“analog.m”:&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
Fs = 100; % Frecventa de esantionare&lt;br /&gt;
Fc=10;  % Frecventa purtatoarei&lt;br /&gt;
t = [0:1/Fs:10]'; % perioada de timp in care se preleveaza esantioane&lt;br /&gt;
x = sin(2*pi*t); % semnalul modulator&lt;br /&gt;
figure(1);&lt;br /&gt;
subplot(3,1,1);&lt;br /&gt;
plot(t,x);  % reprezentarea grafica a semnalului x(t)&lt;br /&gt;
title('Semnal modulator');&lt;br /&gt;
xlabel('Timp');&lt;br /&gt;
ylabel('Amplitudine'); &lt;br /&gt;
spectrux = fft(x);&lt;br /&gt;
spectrux = abs(spectrux(1:length(spectrux)/2+1));&lt;br /&gt;
freq = ([0:length(spectrux)-1]/length(spectrux))*Fs/2;&lt;br /&gt;
figure(2);&lt;br /&gt;
subplot(3,1,1);&lt;br /&gt;
plot(freq,spectrux); % reprezentarea grafica a spectrului semnalului x(t)&lt;br /&gt;
title('Spectrul semnalului modulator');&lt;br /&gt;
xlabel('Frecventa');&lt;br /&gt;
ylabel('Amplitudine');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=1332"&gt;grafic.bmp&lt;/a&gt; (158118 bytes | downloaded 2 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409468/409468/help-generare-grafic/</guid>
      <pubDate>Tue, 17 Nov 2009 12:36:40 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Help generare grafic</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409467/409467/help-generare-grafic/</link>
      <description>As avea nevoie de ajutor referitor la realizarea unui grafic in matlab. Va atasez graficul si cerintele sunt urmatoarele:&lt;br /&gt;
   Semnalul modulator va fi situat în banda . 0,1-1khz               . şi va avea spectrul de forma din figura. Frecvenţa de eşantionare, Fs, va fi de. 50khz. Frecvenţa purtătoarei va fi de 0,1*Fs. Perioada de timp în care se prelevează eşantioane va fi aleasă astfel încât sa cuprindă minim 2 perioade din fiecare componentă spectrală a semnalului modulator.Ideea e ca se porneste de la un fisier pe care vi-l scriu mai jos.As fi recunoscatoare daca ar stii careva cum pot sa obtin graficul ,pornind de la fisier. Va multumesc mult:)&lt;br /&gt;
&lt;br /&gt;
“analog.m”:&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
Fs = 100; % Frecventa de esantionare&lt;br /&gt;
Fc=10;  % Frecventa purtatoarei&lt;br /&gt;
t = [0:1/Fs:10]'; % perioada de timp in care se preleveaza esantioane&lt;br /&gt;
x = sin(2*pi*t); % semnalul modulator&lt;br /&gt;
figure(1);&lt;br /&gt;
subplot(3,1,1);&lt;br /&gt;
plot(t,x);  % reprezentarea grafica a semnalului x(t)&lt;br /&gt;
title('Semnal modulator');&lt;br /&gt;
xlabel('Timp');&lt;br /&gt;
ylabel('Amplitudine'); &lt;br /&gt;
spectrux = fft(x);&lt;br /&gt;
spectrux = abs(spectrux(1:length(spectrux)/2+1));&lt;br /&gt;
freq = ([0:length(spectrux)-1]/length(spectrux))*Fs/2;&lt;br /&gt;
figure(2);&lt;br /&gt;
subplot(3,1,1);&lt;br /&gt;
plot(freq,spectrux); % reprezentarea grafica a spectrului semnalului x(t)&lt;br /&gt;
title('Spectrul semnalului modulator');&lt;br /&gt;
xlabel('Frecventa');&lt;br /&gt;
ylabel('Amplitudine');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=1331"&gt;grafic.bmp&lt;/a&gt; (158118 bytes | downloaded 5 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409467/409467/help-generare-grafic/</guid>
      <pubDate>Tue, 17 Nov 2009 12:34:57 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>*while* loop homework problem</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409396/409396/while-loop-homework-problem/</link>
      <description>"One interesting property of a Fibonacci sequence is that the ratio of the values of adjacent members of the sequence approach a number called “the golden ratio” or PHI. Create a program that accepts the first two numbers of a Fibonacci sequence as a user input and then calculates additional values in the sequence until the ratio of adjacent values converges to within 0.001. You can do this in a WHILE loop by comparing the ratio of element k to element k-1 and the ratio of element k-1 to element k-2. If you call your sequence x, then the code for the WHILE statement is&lt;br /&gt;
&lt;br /&gt;
while abs(x(k)/x(k-1) – x(k-1)/x(k-2))&amp;gt;0.001"&lt;br /&gt;
&lt;br /&gt;
the first part of the code is:&lt;br /&gt;
x(1)=input('Enter the first starting value for your Fibonacci: ')&lt;br /&gt;
x(2)=input('Enter the second starting value for your Fibonacci: ')&lt;br /&gt;
&lt;br /&gt;
^^^but idk how to complete the rest with the WHILE loop&lt;br /&gt;
&lt;br /&gt;
i need to calculate how many terms [k] are needed to get an error within 0.001 units but im clueless...thanx in advance for any help guys&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409396/409396/while-loop-homework-problem/</guid>
      <pubDate>Mon, 16 Nov 2009 14:22:33 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>[deleted]</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409393/409393/deleted/</link>
      <description>[this thread is deleted]</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409393/409393/deleted/</guid>
      <pubDate>Mon, 16 Nov 2009 13:28:43 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Need Import/Export Help in Matlab!!</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409341/409341/need-importexport-help-in-matlab/</link>
      <description>Hi guys:&lt;br /&gt;
I want to import several txt files into Matlab and export the results(parameters) as several excel files(in one is prefer if possible) after Matlab execuation. Is it possible to do this in Matlab?&lt;br /&gt;
Thanks in advance!!&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409341/409341/need-importexport-help-in-matlab/</guid>
      <pubDate>Sun, 15 Nov 2009 23:37:32 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Would you like to Share Algorithms software of Image Processing?</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409270/409270/would-you-like-to-share-algorithms-software-of-image-processing/</link>
      <description>Hi, MATLAB`ers&lt;br /&gt;
 My Name : Tibyani, man, 40 years old, a Ph.D Student Grad. IPS, Waseda University. in image Processing.&lt;br /&gt;
&lt;br /&gt;
Now, I am studying about feature extraction and pattern matching,&lt;br /&gt;
&lt;br /&gt;
Do you have sourcecode MATLAB : Modified Dynamic Programming, Geometrical Features, Hu Invariant Moment, Countur Moment, Curvature Scale Space, Modified Fourier Descriptor ?&lt;br /&gt;
&lt;br /&gt;
if, OK, Please share that algorithms to me !&lt;br /&gt;
&lt;br /&gt;
Best Regards&lt;br /&gt;
Tibyani&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409270/409270/would-you-like-to-share-algorithms-software-of-image-processing/</guid>
      <pubDate>Fri, 13 Nov 2009 20:30:42 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>bioinformatics toolbox- command from turoial won't work</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409262/409262/bioinformatics-toolbox--command-from-turoial-wont-work/</link>
      <description>I am trying to do an HMM alignment, and I am talking the commands straight out of the tutorial, and I am getting errors. It is funny, because I can do other tutorials, its not like the whole thing is broken.&lt;br /&gt;
This is what happens:&lt;br /&gt;
&lt;br /&gt;
hmmmodel  = gethmmprof('PF00002')&lt;br /&gt;
&lt;br /&gt;
is the command.&lt;br /&gt;
&lt;br /&gt;
error:&lt;br /&gt;
??? Error using ==&amp;gt; pfamhmmread at 70&lt;br /&gt;
Input is not a valid PFAM file.&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; getsangerdata at 180&lt;br /&gt;
        out = pfamhmmread(s);&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; gethmmprof at 82&lt;br /&gt;
        model = getsangerdata(accessnum,'database','hmm',varargin{
:});&lt;br /&gt;
 &lt;br /&gt;
Does anyone know what is going on? &lt;br /&gt;
Thanks.&lt;br /&gt;
Mark&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409262/409262/bioinformatics-toolbox--command-from-turoial-wont-work/</guid>
      <pubDate>Fri, 13 Nov 2009 14:27:57 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>bioinformatics toolbox- command from turoial won't work</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409261/409261/bioinformatics-toolbox--command-from-turoial-wont-work/</link>
      <description>I am trying to do an HMM alignment, and I am talking the commands straight out of the tutorial, and I am getting errors. It is funny, because I can do other tutorials, its not like the whole thing is broken.&lt;br /&gt;
This is what happens:&lt;br /&gt;
&lt;br /&gt;
hmmmodel  = gethmmprof('PF00002')&lt;br /&gt;
&lt;br /&gt;
is the command.&lt;br /&gt;
&lt;br /&gt;
error:&lt;br /&gt;
??? Error using ==&amp;gt; pfamhmmread at 70&lt;br /&gt;
Input is not a valid PFAM file.&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; getsangerdata at 180&lt;br /&gt;
        out = pfamhmmread(s);&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; gethmmprof at 82&lt;br /&gt;
        model = getsangerdata(accessnum,'database','hmm',varargin{
:});&lt;br /&gt;
 &lt;br /&gt;
Does anyone know what is going on? &lt;br /&gt;
Thanks.&lt;br /&gt;
Mark&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409261/409261/bioinformatics-toolbox--command-from-turoial-wont-work/</guid>
      <pubDate>Fri, 13 Nov 2009 14:26:09 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Image Segmentation Using Matlab</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409193/409193/image-segmentation-using-matlab/</link>
      <description>Hello,&lt;br /&gt;
   I m a computer science student and i m working on a project on matlab and currently im stuck in a problem.The problem is that i want to &lt;br /&gt;
&lt;br /&gt;
extract head from this image without using imcrop command meaning that it should automatically search and detect the head(keeping this as the &lt;br /&gt;
&lt;br /&gt;
basic or common shape of the head) and extract the head from the background.Assuming the shape of the head to be like that for every image &lt;br /&gt;
&lt;br /&gt;
but "the size may vary".&lt;br /&gt;
Here is my sample image for the head shape&lt;br /&gt;
&lt;a href="http://img226.imagevenue.com/img.php?image=80992_4_122_64lo.jpg"&gt;http://img226.imagevenue.com/img.php?image=80992_4_122_64lo.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I would really appreciate your help,suggestions,references and support&lt;br /&gt;
or a sample code/demo on a matlab would be nice &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409193/409193/image-segmentation-using-matlab/</guid>
      <pubDate>Thu, 12 Nov 2009 21:18:15 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Image Segmentation Using Matlab</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409192/409192/image-segmentation-using-matlab/</link>
      <description>Hello,&lt;br /&gt;
   I m a computer science student and i m working on a project on matlab and currently im stuck in a problem.The problem is that i want to &lt;br /&gt;
&lt;br /&gt;
extract head from this image without using imcrop command meaning that it should automatically search and detect the head(keeping this as the &lt;br /&gt;
&lt;br /&gt;
basic or common shape of the head) and extract the head from the background.Assuming the shape of the head to be like that for every image &lt;br /&gt;
&lt;br /&gt;
but "the size may vary".&lt;br /&gt;
Here is my sample image for the head shape&lt;br /&gt;
&lt;a href="http://img226.imagevenue.com/img.php?image=80992_4_122_64lo.jpg"&gt;http://img226.imagevenue.com/img.php?image=80992_4_122_64lo.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I would really appreciate your help,suggestions,references and support&lt;br /&gt;
or a sample code/demo on a matlab would be nice &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409192/409192/image-segmentation-using-matlab/</guid>
      <pubDate>Thu, 12 Nov 2009 21:15:14 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>MRD file</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409164/409164/mrd-file/</link>
      <description>Hi,&lt;br /&gt;
  Can you please help me in extracting a MRD file and get the information from it to a microsoft excel file.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Sailaja.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409164/409164/mrd-file/</guid>
      <pubDate>Thu, 12 Nov 2009 06:38:25 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Evaluate Function using vectors</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408842/408842/evaluate-function-using-vectors/</link>
      <description>How would I evaluate this using a row vector? (pref no loops! (its horrible!) &lt;br /&gt;
function [y, err] = arctanseries(x,n)  -&amp;gt; x is the row vector, n is just an integer.&lt;br /&gt;
&lt;br /&gt;
Thank you in advance to all who try! &lt;br /&gt;
&lt;pre class="sourcecode"&gt;

function [y, err] = arctanseries(x,n)

if(x&amp;gt;=(-1))&amp;amp;(x&amp;lt;=1)
    power = [];
    nom = [];
    denom = [];
    neg = [];
    answer = [];
    
    % Vector neg, alternating values, 1 -1 1 -1 for arctanseries
    neg = ones(1,n);
    neg(2:2:end) = -1;
    
    % Vector power, starts at 1, increases by 2 for n-1 times
    power = 1:2:((2*n)-1);
    
    % Vector denom, denominator of the arctanseries. stats at 1
    denom = 1:2:((2*n)-1);
    
    % Vector nom, nominator equals x
    nom = (ones(1,n))*x;
    
    % solve arctan series 
    answer = nom .^ power;
    answer = answer .* neg;
    answer = sum(answer ./ denom);
    
    % ***Output***
    y = answer;
else
    err = error('Input Error: x must be between -1 and 1 inclusive')
end

&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408842/408842/evaluate-function-using-vectors/</guid>
      <pubDate>Wed, 04 Nov 2009 18:28:07 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Evaluate Function using vectors</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408841/408841/evaluate-function-using-vectors/</link>
      <description>How would I evaluate this using a row vector? (pref no loops! (its horrible!) &lt;br /&gt;
function [y, err] = arctanseries(x,n)  -&amp;gt; x is the row vector, n is just an integer.&lt;br /&gt;
&lt;br /&gt;
Thank you in advance to all who try! &lt;br /&gt;
&lt;pre class="sourcecode"&gt;

function [y, err] = arctanseries(x,n)

if(x&amp;gt;=(-1))&amp;amp;(x&amp;lt;=1)
    power = [];
    nom = [];
    denom = [];
    neg = [];
    answer = [];
    
    % Vector neg, alternating values, 1 -1 1 -1 for arctanseries
    neg = ones(1,n);
    neg(2:2:end) = -1;
    
    % Vector power, starts at 1, increases by 2 for n-1 times
    power = 1:2:((2*n)-1);
    
    % Vector denom, denominator of the arctanseries. stats at 1
    denom = 1:2:((2*n)-1);
    
    % Vector nom, nominator equals x
    nom = (ones(1,n))*x;
    
    % solve arctan series 
    answer = nom .^ power;
    answer = answer .* neg;
    answer = sum(answer ./ denom);
    
    % ***Output***
    y = answer;
else
    err = error('Input Error: x must be between -1 and 1 inclusive')
end

&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408841/408841/evaluate-function-using-vectors/</guid>
      <pubDate>Wed, 04 Nov 2009 18:25:50 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>MATLAB LOADING DATA FROM A .TXT FILE</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408647/408647/matlab-loading-data-from-a-txt-file/</link>
      <description>MATLAB LOADING DATA FROM A .TXT FILE?&lt;br /&gt;
&lt;br /&gt;
Please I need some help with this to finish my thesis.&lt;br /&gt;
 &lt;br /&gt;
I tried to load the solution.txt file in MATLAB, but i have been &lt;br /&gt;
unable to do it because it sais that there is a format problem &lt;br /&gt;
with the first rows, however i only need to load the rows 6 to 9 from the file &lt;br /&gt;
wich have a recognazible format and can be loaded with the textread function&lt;br /&gt;
&lt;br /&gt;
The solution.txt file has the following data:&lt;br /&gt;
&lt;br /&gt;
        OBJECTIVE FUNCTION VALUE&lt;br /&gt;
&lt;br /&gt;
        1)      3942307.    &lt;br /&gt;
&lt;br /&gt;
  VARIABLE        VALUE      REDUCED COST&lt;br /&gt;
     UI001         0.02     -96876.960938&lt;br /&gt;
     UI002         0.06     359612.000000&lt;br /&gt;
     UI003         0.01     392966.000000&lt;br /&gt;
     UI004         0.05     392966.000000&lt;br /&gt;
&lt;br /&gt;
       ROW   SLACK OR SURPLUS     DUAL PRICES&lt;br /&gt;
        2)         0.000000        -30.976025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I only need to load rows 6 to 9, without changing in any way the solution.txt file.&lt;br /&gt;
The data i need would be:&lt;br /&gt;
&lt;br /&gt;
     UI001         0.02     -96876.960938&lt;br /&gt;
     UI002         0.06     359612.000000&lt;br /&gt;
     UI003         0.01     392966.000000&lt;br /&gt;
     UI004         0.05     392966.000000&lt;br /&gt;
&lt;br /&gt;
Could someone please tell me what function can i use to load the solution.txt file&lt;br /&gt;
but delimited only to the rows 6 to 9?&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408647/408647/matlab-loading-data-from-a-txt-file/</guid>
      <pubDate>Sat, 31 Oct 2009 15:37:52 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>drawing 3D plot using multiple 2D plots</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408629/408629/drawing-3d-plot-using-multiple-2d-plots/</link>
      <description>Hi, I am new learner of Matlab. I need your help urgently on drawing 3D plot using multiple 2D plots of x and y. &lt;br /&gt;
I have many data sets of x and y points in text file which create the non-uniform shape of two circles. Each data set gives different size of circle. &lt;br /&gt;
Using these multiple 2D slices, I need to create the 3D shape by stack them together in Z direction. &lt;br /&gt;
&lt;br /&gt;
Can anyone help me out? &lt;br /&gt;
&lt;br /&gt;
output image that I wanted is attached. &lt;br /&gt;
&lt;br /&gt;
Thanks for your help!!! &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408629/408629/drawing-3d-plot-using-multiple-2d-plots/</guid>
      <pubDate>Sat, 31 Oct 2009 08:30:07 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>How can i do parallel processing in matlab????????????</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408507/408507/how-can-i-do-parallel-processing-in-matlab/</link>
      <description>How can i do parallel processing in matlab???????&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408507/408507/how-can-i-do-parallel-processing-in-matlab/</guid>
      <pubDate>Wed, 28 Oct 2009 20:45:29 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>plz explain to me why this!!!!!</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408441/408441/plz-explain-to-me-why-this/</link>
      <description>hi guys, good morning&lt;br /&gt;
&lt;br /&gt;
guys im facing a little problem and need ur help if u dont mind&lt;br /&gt;
&lt;br /&gt;
i use maple kernel function in my program, here is the code:::&lt;br /&gt;
&lt;br /&gt;
maple('m:=',m_int2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
m := matrix([[119, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 101, 108, 103, 97, 109, 97, 108, 32, 101, 110, 99, 114, 121, 112, 116, 105, 111, 110, 32, 112, 97, 114, 116]])&lt;br /&gt;
&lt;br /&gt;
but when i pass result from maple kernel function to matlam platform i got this answer&lt;br /&gt;
&lt;br /&gt;
mm=maple('m')&lt;br /&gt;
&lt;br /&gt;
mm =&lt;br /&gt;
&lt;br /&gt;
11910110809911110910103211611103210110810309710909
71080321011100991141211121161051111100321120971141
16&lt;br /&gt;
&lt;br /&gt;
as u can see guys the spaces between elements is deleted and answer looks like one number.....&lt;br /&gt;
&lt;br /&gt;
do u know why this happened???!!!!&lt;br /&gt;
&lt;br /&gt;
is there anyway 2 return answer back as it was inside maple kernel function???!!! i hope yes and u can help me guys&lt;br /&gt;
&lt;br /&gt;
thank u very much&lt;br /&gt;
&lt;br /&gt;
waiting 4 ur reply&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408441/408441/plz-explain-to-me-why-this/</guid>
      <pubDate>Tue, 27 Oct 2009 20:59:52 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>anyone can help plz with this problem</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408426/408426/anyone-can-help-plz-with-this-problem/</link>
      <description>hi guys&lt;br /&gt;
how r is everyone???!! i hope u r fine and ok&lt;br /&gt;
&lt;br /&gt;
goodmorning....&lt;br /&gt;
&lt;br /&gt;
guys i write code and i need ur help with it....&lt;br /&gt;
let take example to make problem clear 2 u&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
m_int2 =&lt;br /&gt;
&lt;br /&gt;
welcome to elgamal encryption part&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; m_int2 = double(m_int2)&lt;br /&gt;
m_int2 =&lt;br /&gt;
&lt;br /&gt;
  Columns 1 through 8 &lt;br /&gt;
&lt;br /&gt;
   119   101   108    99   111   109   101    32&lt;br /&gt;
&lt;br /&gt;
  Columns 9 through 16 &lt;br /&gt;
&lt;br /&gt;
   116   111    32   101   108   103    97   109&lt;br /&gt;
&lt;br /&gt;
  Columns 17 through 24 &lt;br /&gt;
&lt;br /&gt;
    97   108    32   101   110    99   114   121&lt;br /&gt;
&lt;br /&gt;
  Columns 25 through 32 &lt;br /&gt;
&lt;br /&gt;
   112   116   105   111   110    32   112    97&lt;br /&gt;
&lt;br /&gt;
  Columns 33 through 34 &lt;br /&gt;
&lt;br /&gt;
   114   116&lt;br /&gt;
&lt;br /&gt;
maple('m:=',m_int2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
m := matrix([[119, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 101, 108, 103, 97, 109, 97, 108, 32, 101, 110, 99, 114, 121, 112, 116, 105, 111, 110, 32, 112, 97, 114, 116]])&lt;br /&gt;
&lt;br /&gt;
------------------------------ upto here everything is normal untill now&lt;br /&gt;
&lt;br /&gt;
now come to the line makes problem 2 me,,, the line is&lt;br /&gt;
&lt;br /&gt;
maple('c2:= m*k^rr1 mod P')&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
c2 := 908*m&lt;br /&gt;
&lt;br /&gt;
as u can see guys, the result of c2 must be number only, i mean maple function should takes each element in matrix m and multiply it with k to the power of rr1,since value of rr1 is known by user.&lt;br /&gt;
&lt;br /&gt;
but here result of c2=908*m whereas it should be in this form c2=908*112(112 is example) not should be the real value of resultant multiplication.&lt;br /&gt;
&lt;br /&gt;
i wish guys u understand my point and make it clear 2 u&lt;br /&gt;
&lt;br /&gt;
waiting ur reply and comment guys.&lt;br /&gt;
&lt;br /&gt;
thank u very much&lt;br /&gt;
&lt;br /&gt;
buy buy&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408426/408426/anyone-can-help-plz-with-this-problem/</guid>
      <pubDate>Tue, 27 Oct 2009 14:29:26 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>anyone can help plz with this problem</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408425/408425/anyone-can-help-plz-with-this-problem/</link>
      <description>hi guys&lt;br /&gt;
how r is everyone???!! i hope u r fine and ok&lt;br /&gt;
&lt;br /&gt;
goodmorning....&lt;br /&gt;
&lt;br /&gt;
guys i write code and i need ur help with it....&lt;br /&gt;
let take example to make problem clear 2 u&lt;br /&gt;
-----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
m_int2 =&lt;br /&gt;
&lt;br /&gt;
welcome to elgamal encryption part&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; m_int2 = double(m_int2)&lt;br /&gt;
m_int2 =&lt;br /&gt;
&lt;br /&gt;
  Columns 1 through 8 &lt;br /&gt;
&lt;br /&gt;
   119   101   108    99   111   109   101    32&lt;br /&gt;
&lt;br /&gt;
  Columns 9 through 16 &lt;br /&gt;
&lt;br /&gt;
   116   111    32   101   108   103    97   109&lt;br /&gt;
&lt;br /&gt;
  Columns 17 through 24 &lt;br /&gt;
&lt;br /&gt;
    97   108    32   101   110    99   114   121&lt;br /&gt;
&lt;br /&gt;
  Columns 25 through 32 &lt;br /&gt;
&lt;br /&gt;
   112   116   105   111   110    32   112    97&lt;br /&gt;
&lt;br /&gt;
  Columns 33 through 34 &lt;br /&gt;
&lt;br /&gt;
   114   116&lt;br /&gt;
&lt;br /&gt;
maple('m:=',m_int2)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
m := matrix([[119, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 101, 108, 103, 97, 109, 97, 108, 32, 101, 110, 99, 114, 121, 112, 116, 105, 111, 110, 32, 112, 97, 114, 116]])&lt;br /&gt;
&lt;br /&gt;
------------------------------ upto here everything is normal untill now&lt;br /&gt;
&lt;br /&gt;
now come to the line makes problem 2 me,,, the line is&lt;br /&gt;
&lt;br /&gt;
maple('c2:= m*k^rr1 mod P')&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
c2 := 908*m&lt;br /&gt;
&lt;br /&gt;
as u can see guys, the result of c2 must be number only, i mean maple function should takes each element in matrix m and multiply it with k to the power of rr1,since value of rr1 is known by user.&lt;br /&gt;
&lt;br /&gt;
but here result of c2=908*m whereas it should be in this form c2=908*112(112 is example) not should be the real value of resultant multiplication.&lt;br /&gt;
&lt;br /&gt;
i wish guys u understand my point and make it clear 2 u&lt;br /&gt;
&lt;br /&gt;
waiting ur reply and comment guys.&lt;br /&gt;
&lt;br /&gt;
thank u very much&lt;br /&gt;
&lt;br /&gt;
buy buy&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408425/408425/anyone-can-help-plz-with-this-problem/</guid>
      <pubDate>Tue, 27 Oct 2009 14:27:45 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>guys need ur help plz</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408415/408415/guys-need-ur-help-plz/</link>
      <description>hi guys, i need ur help&lt;br /&gt;
i have a matrix contains (let's say 30 elements)&lt;br /&gt;
&lt;br /&gt;
how can i split or chunk them into 30 variables, where each variable contains 1 element of the biggest one,,,&lt;br /&gt;
&lt;br /&gt;
let's take this example 2 make it clear 4 u,&lt;br /&gt;
&lt;br /&gt;
a=[ 1 2 3 4 5 6 7 8 9], here a contains 9 elements, so how can i split them into 9 variables where each variable contains 1 element of a!!!!??? is it clear now!!!!&lt;br /&gt;
i hope that&lt;br /&gt;
&lt;br /&gt;
remember guys, number of variables depend on the number of element of the biggest matrix&lt;br /&gt;
&lt;br /&gt;
waiting ur replies&lt;br /&gt;
&lt;br /&gt;
thank u very much&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408415/408415/guys-need-ur-help-plz/</guid>
      <pubDate>Tue, 27 Oct 2009 12:00:59 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>For Loop , Need Help</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408374/408374/for-loop--need-help/</link>
      <description>Hi&lt;br /&gt;
&lt;br /&gt;
I try to  use a block operation in a image 400x400. It works fine . Now if i use different image this code does not work. So please any one tell me how to add padding zeros using the for loop.&lt;br /&gt;
&lt;br /&gt;
We have  a function in matlab, but i want to use in this for loop same thing ,  please any one tell me how to do that .  my code &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;

I  = imread('5.jpg');
Block size (bk) = 50;
  for j = 1:bk:size(rgb,2)
         for i = 1:bk:size(rgb,1)
         block = gray(i:(i+(bk-1)), j:(j+(bk-1)));

/// do some operation 

      end
  end
 figure,imshow(z);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The above code works fine if the image size is divided by Block size, but if the image size if different , then there is a error like this &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
??? Index exceeds matrix dimensions.&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; block_gradient at 12&lt;br /&gt;
         block = gray(i:(i+(bk-1)), j:(j+(bk-1)));&lt;br /&gt;
&lt;br /&gt;
So please any one help me to fix this . How to add padding inside this loop, so that this will work for all image.&lt;br /&gt;
&lt;br /&gt;
Thank You&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408374/408374/for-loop--need-help/</guid>
      <pubDate>Mon, 26 Oct 2009 19:56:43 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>need help with this problem</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/408351/408351/need-help-with-this-problem/</link>
      <description>hi there&lt;br /&gt;
how r u guys? its been long time, guys i have problem and need ur help&lt;br /&gt;
i write a program usig matlab, i use some maple kernel functions in matlab, here i will put u in the picture, the code i use is&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
maple('c1:=G^rr1 mod P')&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
c1 := 573&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; leng=length(e8)&lt;br /&gt;
&lt;br /&gt;
leng =&lt;br /&gt;
&lt;br /&gt;
    34&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; c11(1:leng)=c1&lt;br /&gt;
??? Undefined function or variable 'c1'.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; c1=c1&lt;br /&gt;
??? Undefined function or variable 'c1'.&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
the problem occures after finishing maple function, an error message appears and it ssays c1 is undefined function or variable as u can see above.....&lt;br /&gt;
&lt;br /&gt;
why does this happen???!!! where is the mistake i have done!!!!&lt;br /&gt;
plz guys tell me how 2 solve it???!!!&lt;br /&gt;
&lt;br /&gt;
is there anyway 2 call result from maple kernel to matlab???!!!&lt;br /&gt;
&lt;br /&gt;
my whole project depends on it&lt;br /&gt;
&lt;br /&gt;
help me guys plz&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=1255"&gt;Snap_maple error.jpg&lt;/a&gt; (24219 bytes | downloaded 8 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/408351/408351/need-help-with-this-problem/</guid>
      <pubDate>Mon, 26 Oct 2009 08:57:26 -0700</pubDate>
      <category>Matlab</category>
    </item>
  </channel>
</rss>