Help

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help

Octave - General mailing list
Hi there. 

I was wondering if you can help me. I’m a second year electronic engineering student in Ireland and part of the course is to use Mathlab in college. As the college is closed due to Covid19 we were instructed to install octave. I’m having an issue using the build in functions in octave that would normally work in Mathlab.
I have attached the problem that I am having. It is at the bottom of the page, where I am trying to find rms using a built in function. I’m getting an error with this (as seen in picture). Also I tried to install the package “signal” but also kept getting errors. 

Any help that you could give me would be greatly appreciated. 

Regards

David Donoghue



Reply | Threaded
Open this post in threaded view
|

Re: Help

nrjank
Administrator

On Thu, Apr 2, 2020 at 9:52 AM Jim Donoghue via Help-octave <[hidden email]> wrote:
Hi there. 

I was wondering if you can help me. I’m a second year electronic engineering student in Ireland and part of the course is to use Mathlab in college. As the college is closed due to Covid19 we were instructed to install octave. I’m having an issue using the build in functions in octave that would normally work in Mathlab.
I have attached the problem that I am having. It is at the bottom of the page, where I am trying to find rms using a built in function. I’m getting an error with this (as seen in picture). Also I tried to install the package “signal” but also kept getting errors. 


Thanks for reaching out.  first a quick request, would you mind sharing the University that is doing this shift? Please pass along a request to your professor to reach out to this help list at any time, I'm sure people here would we willing to assist if he needs help with this transition.

Now to your problem - please copy and paste the inputs/outputs into emails as text not images, it's easier for people to help you that way.  Long scripts can be attached as m files.  

What operating system are you using? What version of octave do you have installed, and how did you install it.  

what output do you get from:
>> pkg list

if you see the package listed, you have to first load it using 

>> pkg load signal

if you don't see any packages listed, if you are running windows you can try:

>> pkg rebuild

what errors do you get when you try 

>> pkg install -forge signal


Reply | Threaded
Open this post in threaded view
|

Re: Help

Torsten Lilge
In reply to this post by Octave - General mailing list
On Thu, 2020-04-02 at 14:03 +0100, Jim Donoghue via Help-octave wrote:

> Hi there.
>
> I was wondering if you can help me. I’m a second year electronic
> engineering student in Ireland and part of the course is to use
> Mathlab in college. As the college is closed due to Covid19 we were
> instructed to install octave. I’m having an issue using the build in
> functions in octave that would normally work in Mathlab.
> I have attached the problem that I am having. It is at the bottom of
> the page, where I am trying to find rms using a built in function. I’m
> getting an error with this (as seen in picture). Also I tried to
> install the package “signal” but also kept getting errors.
>
> Any help that you could give me would be greatly appreciated.
>
> Regards
>
> David Donoghue
>

At the end of the warning message, you might find the solution:
"... which you have installed but not loaded. To load the package run
'pkg load signal' ..."

You can get a list of all installed packages with the command 'ver'. A
package is also loaded, when the package name ist starred with '*'.

Torsten



Reply | Threaded
Open this post in threaded view
|

Re: Help

Josua Stingelin
In reply to this post by Octave - General mailing list
Hi David,

Please try to install the signal package using

   pkg install signal -forge

If you get errors during install we will require additional information about
your environment and more information about the specific error.

Also after installing the signal package you must load it before using it.

   pkg load signal

Kind Regards,


Reply | Threaded
Open this post in threaded view
|

Re: Help

Octave - General mailing list
In reply to this post by Octave - General mailing list


On 02/04/2020 16:03, Jim Donoghue via Help-octave wrote:
Hi there. 

I was wondering if you can help me. I’m a second year electronic engineering student in Ireland and part of the course is to use Mathlab in college. As the college is closed due to Covid19 we were instructed to install octave. I’m having an issue using the build in functions in octave that would normally work in Mathlab.
I have attached the problem that I am having. It is at the bottom of the page, where I am trying to find rms using a built in function. I’m getting an error with this (as seen in picture). Also I tried to install the package “signal” but also kept getting errors. 

Any help that you could give me would be greatly appreciated. 

Regards

David Donoghue



    


Did you read the error message ? Specifically, were did you have problems comprehending "run 'pkg load signal'" ?

--Sergei.



Reply | Threaded
Open this post in threaded view
|

Re: Help

DigitalHermit
In reply to this post by Octave - General mailing list


On Thu, Apr 2, 2020 at 9:52 AM Jim Donoghue via Help-octave <[hidden email]> wrote:
I have attached the problem that I am having. It is at the bottom of the page, where I am trying to find rms using a built in function. I’m getting an error with this (as seen in picture). Also I tried to install the package “signal” but also kept getting errors. 

Any help that you could give me would be greatly appreciated. 

Jim:
   I see a couple things immediately:

'sum' is the name of a function in Octave so you may get an error. You could try re-naming to 'Sum' to work around this.

To install the signal package, you will need to also install the 'control' package. So something like this from the octave command prompt:
  pkg install -forge control signal

For harmmean, you will need:
  pkg install -forge io statistics

This should allow it to continue:

N =  5
Sum = 0
Please enter numbers: 1
Please enter numbers: 2
Please enter numbers: 3
Please enter numbers: 4
Please enter numbers: 5

 The Arithmetic mean is 3.00
 The Quadratic mean is 3.32
 The Harmonic mean is 2.19
arithmetic =  3
quadratic =  3.3166
harmonic =  2.1898


--
"Don't be lazy. Do the thing. Do it properly."  - Simone Giertz



Screen Shot 2020-04-02 at 13.58.12.png (188K) Download Attachment
Screen Shot 2020-04-02 at 14.02.29.png (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help

DigitalHermit
On Thu, Apr 2, 2020 at 1:04 PM Jim Donoghue <[hidden email]> wrote:
>
> Hi Kwan.
>
> Thanks for your email. I’m using octave on MacBook and tried installing the signal package using the way you showed me. I got errors. I’ll try it again without using sum too.

Here's the script that works for me:
pkg load signal
pkg load statistics
N=5 %setting a value for N for 5 numbers
Sum=0 %initilalsing the sum to @ to be used to calculate sum

for i = 1:N %for Loop starting from 1 and ending at 5
In(i) = input('Please enter numbers: '); %asks user to input a number
and will loop 5 times
Sum = Sum + In(i); %used to calculate the sum

endfor

Am = 1/(N) * Sum; %Formula to find Aritmetric mean

Qm = sqrt((In(1)^2 + In(2)^2 + In(3)^2 + In(4)^2 + In(5)^2) / N);
%Formula to find Quadradic mear
Hm = N/ (1/In(1) + 1/In(2) + 1/In(3) + 1/In(4) + 1/In(5));%Formula to
find Harmonic mean

fprintf('\n The Arithmetic mean is %2.2f',Am); %Prints answer to screen
fprintf('\n The Quadratic mean is %2.2f',Qm);
fprintf('\n The Harmonic mean is %2.2f\n' ,Hm);

arithmetic = mean(In) %Finding the same answers using the build in functions
quadratic = rms(In)
harmonic = harmmean(In)


> --
> "Don't be lazy. Do the thing. Do it properly."  - Simone Giertz



--
"Don't be lazy. Do the thing. Do it properly."  - Simone Giertz