help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing the values in a fixed format


From: Samuel Doughty
Subject: Re: Passing the values in a fixed format
Date: Wed, 24 Jun 2020 13:25:34 -0500

Trouble Using Functions

I've written a short script to use functions, and it does not run for me (it says the first function encountered is not defined). Any help would be appreciated. Here is my script:

% TestFile1
p=[1;2;3]
q=[3;4;7]
ssq=s2(q);
[add,subt]=s1(p,q);

function [sum,diff]=s1(a,b)
  print "   Function s1 -- sum and difference"
  sum=a+b
  diff=a-b
endfunction
function sumsq=s2(a)
  print "   Function s2 -- sum of squares"
  sumsq=a'*a
endfunction

Virus-free. www.avast.com

On Wed, Jun 24, 2020 at 12:17 PM Ganesh Kini <ganeshrkini19@gmail.com> wrote:
I have 2 arrays

Position = {"ITC""VTC""KZT"};

Direction = [0.34 0.56 0.99]

abc = interpm (.. )

I have a pass these values to a interpn function such a way it should pass as set of values, which means i should pass like Position = "ITC" and direction = 0.34 , during the next position = "VTC" and direction = 0.56 and the last one. how do i do that  ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]