loading...

Genre-Nature; Style: Macro Photography


A budding flower is being portrayed in the above picture  

Use of GNU Octave over MATLAB and a general comparison between them


Introduction: 
GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and non-linear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with MATLAB.

Abstract: 
GNU Octave is basically an open-source software and can be easily downloaded and freely used for solving almost all the critical problems as much as is possible in the case of Mathworks (Trade Mark.) MATLAB. Although you have to pay a high fee for access to the large library and functions provided by MATLAB, whereas in case of GNU Octave it is not so. GNU Octave is a free of cost and open-source software (comes with the perks of being an open-source software), easily customizable software. Specially for students who are spared with just one month of free subscription for the expensive MATLAB software, GNU Octave comes as a boon.

How to download: Below I will be providing with the links to download both GNU Octave and MATLAB and explain the steps to do so:

       To install GNU Octave follow the steps given below:

        
Download (gnu.org)
Download the Octave installer file from the link above.
Save the downloaded file to your computer.
Double-click on the downloaded Octave installer file.
Now, a smart screen might appear and ask for a confirmation.
Click “Yes” to confirm.
Finally, follow the installation instructions until you get a confirmation notification of a successful installation process.

      To install MATLAB follow the steps as provided below:



    1. Double click on the MATLAB icon (the binary file which we downloaded earlier). After clicking the icon, a pop-up will ask for the installer to run, click on the Run. A MathWorks Installer window will pop-up on the screen.
    2. A license Selection window will appear, a preselected license id will be highlighted with a blue background. Here you have to select your license id; this is the id which we have saved during STEP 9 of downloading of the installer (we urged to note down that id during that time) and again click on Next. 
    3. Next is Product Selection window, the first product is MATLAB 9.6, this is mandatory to select because it is the MATLAB environment, and from other products, you can choose as many of your choices and click on Next. 
    4. After downloading of all products and completion of the installation, a window appears that says to Activate the MATLAB, no need to do anything, click on the Next button. 
    5. A MATLAB shortcut will be created on the desktop as per our choice during the installation process. Now we can work with MATLAB by clicking on the icon placed there on the desktop.

Features of GNU Octave:

1. Command and variable name completion

Typing a TAB character on the command line causes Octave to attempt to complete variable, function, and file names (similar to Bash's tab completion). Octave uses the text before the cursor as the initial portion of the name to complete.

2. Command history

When running interactively, Octave saves the commands typed in an internal buffer so that they can be recalled and edited.

3. Data structures

Octave includes a limited amount of support for organizing data in structures. In this example, we see a structure "x" with elements "a", "b", and "c", (an integer, an array, and a string, respectively):
octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string";
octave:2> x.a
ans =  1
octave:3> x.b
ans =

   1   2
   3   4

octave:4> x.c
ans = string
octave:5> x
x =
{
  a =  1
  b =

     1   2
     3   4

  c = string
}

4.Short-circuit boolean operators
Octave's '&&' and '||' logical operators are evaluated in a short-circuit fashion (like the corresponding operators in the C language), in contrast to the element-by-element operators '&' and '|'.
5.Increment and decrement operators
Octave includes the C-like increment and decrement operators '++' and '--' in both their prefix and
postfix forms. Octave also does augmented assignment, e.g. 'x += 5'.

6.Unwind-protect
Octave supports a limited form of exception handling modelled after the 'unwind_protect'of Lisp. The general form of an unwind protect block looks like this:
unwind_protect
   body
unwind_protect_cleanup
   cleanup
end_unwind_protect
7.Variable-length argument lists
Octave has a mechanism for handling functions that take an unspecified number of
arguments without explicit upper limit. To specify a list of zero or more arguments,
use the special argument varargin as the last (or only) argument in the list.

function s = plus (varargin)
   if (nargin==0)
      s = 0;
   else
      s = varargin{1} + plus (varargin{2:nargin});
   end
end
8.Variable-length return lists

A function can be set up to return any number of values by using the special return
value varargout. For example:
function varargout = multiassign (data)
   for k=1:nargout
      varargout{k} = data(:,k);
   end
end
9.C++ integration
It is also possible to execute Octave code directly in a C++ program. For example,
here is a code snippet for calling rand([10,1]):

#include <octave/oct.h> ...
ColumnVector NumRands(2);
NumRands(0) = 10;
NumRands(1) = 1;
octave_value_list f_arg, f_ret;
f_arg(0) = octave_value(NumRands);

f_ret = feval("rand", f_arg, 1);

Matrix unis(f_ret(0).matrix_value());

C and C++ code can be integrated into GNU Octave by creating oct files, or using the MATLAB compatible MEX files.

Conclusion:
Majority of the features similar to MATLAB are debuted by this open source, free software
and thus GNU Octave can be fully utilised by an Engineer and other interested fellow doing
mathematical computations in higher levels.

Thus it is a very useful, and proven alternative for MATLAB alongside SCILAB and has been
providing a truly remarkable service over the years and years to come.

        Review of a story book: Anne Frank - The Diary of a Young Girl


         While being productive ranks high on seemingly every soul's list this quarantine, I still believe (and sincerely hope from the bottom of my heart) that the planet is inhabited by a bunch of gems who look beyond the mundane, possess an uncanny resemblance of serendipity and stand by the sheer beauty of doing absolutely nothing. After all, this is a pandemic and not a productivity contest. That being said, one profound source of influence in these times for me has been derived from the book 'Diary of a Young Girl' by Anne Frank. Although I read it way back in tenth grade, it still remains one of those literary works that stay with you and are relevant for years to come. What sets apart this highly nuanced book is that it captures the adolescent musings and frailties in a truly impeccable manner. I don't think that Anne realised that by putting her mere teenage rambles and whims she was leaving behind a great treasure, the treasure of thought.

        The most beautiful aspect of the book is the accuracy with which it portrays human relationships-those with your peers as well as family and goes on to discuss matters of war religion, philosophy and everything under the sun where a human mind can possibly go. It is the relatability of this exceedingly personal account that makes one go and open the same pages again and read them with the same smile you once read it with as a tenth grader in school. Anne's account offers a fascinating commentary on human courage and is a compelling self portrait of a spirited young lady with whom I share several commonalities-our interests in the royal No suggestions to view relationships and our ever-thinking overboard minds!

        Anne is also a dreamer who dwells on the deeply philosophical often igniting controversial issues and finding herself in hilarious sticky spots owing to that.

        However, one thing is for sure that Anne believes in the inherent beauty of people and life, she believes in magic and is ever hopeful for a better tomorrow when she will encounter better things. History might disagree with me and say that Anne's wish remained unfulfilled for her promise was tragically cut short but for those who know Anne right from the personal pages from her diary would know that she would be laughing her head off seeing those rather unflattering descriptions of people now reading her book, her incessant chatter almost on the verge of the book being banned in certain areas. Anne's diary is conclusive proof that words have power, they have the power to change and outlive human life, the power to make one's life worth remembering even while one thought one was doing nothing all this time.

        Somewhere in the book, Anne mentions-"What a wonderful thought it is that some of the best days of our life haven't even happened yet" and today I have an after-thought as an answer to her, just like she has had so many for me and that is the fact that the best days of your life are not found in number, age or experiences even. They are only a determinant of how much you loved and were loved. Love of any form is the force that makes life worth living and makes your day worth being counted and that Anne, you have truly earned.

        Also, I would definitely like to add her words as she left them for the reader:

        'I hope I shall be able to confide in you completely, as I have never been able to do in anyone before, and I hope that you will be a great support and comfort to me.'

        Moreover, a brief of the author and what happened to her should be know just as a reminder of how war on humanity looks like and to provide a glance at that I would like to share with you that this diary of a young Jewish girl, Annelies Marie Frank who was a thirteen-year-old girl, who had to go in hiding with her entire family during second world war, has described the horror of world war in her diary.

        Anne Frank was eventually transferred to the Bergen-Belsen concentration camp by the Nazis, where she died in March 1945.



        Coding Solution: C program to calculate simple interest

         Program Input:

        #include <stdio.h>

        int maim()

        {

        int p,r,t,int_amt;

        printf("Input principle, Rate of interest & time to find simple interest:\n");

        scanf("%d%d%d",&p,&r,&t);

        int_amt=(p*r*t)/100;

        printf("Simple interest = %d,int_amt");

        return 0;

        }


        Below, I have represented the inputs that I have used in an online c program compiler:




        Program Output:

        Input principle = 1000
        Input Rate of interest = 10(%)
        Input time = 2(Year)

        Below, I have represented the Outputs that I have obtained from  the online c program compiler:



        Output is showing
        Simple interest as 200