Posts

Showing posts from 2014

How to use Latex mode in matlab

How to use Latex mode in matlab Add the following lines to you code. When you see the file it would look wired but when you see the saved figure you will find everything in place. Remember you have to save the figure in "eps" of  "pdf " format only.     %Program to show how to use Latex mode in matlab x = linspace(1,100,1000); plot(x,sin(x)) text(40,0,'$\bar{Q}$','FontSize',20,'Interpreter','latex') xlabel('$\bar{Q}$','FontSize',20,'Interpreter','latex') ylabel('$\bar{Q}$','FontSize',20,'Interpreter','latex') %One can use "\overline" instead of "\bar", because it's looking pretty good. %text(40,0,'$\overline{Q}$','FontSize',20,'Interpreter','latex') %You can use this also it's pretty good saveas(gcf,'a','epsc') %You can also use 'pdf' to save the figure in "pdf"

Segmentation fault (core dumped) (C, and C++ programming)

Segmentation fault (core dumped) (C, and C++ programming) This is popular error in programming with arrays. It comes due to overshooting the memory limit by declaring the array in static memory allocation . You can solve this by using the dynamic memory allocation of the arrays. All you have to do is declare your array as follow: For (C programming) For one dimensional array: int *a; a = (int *)malloc((array_size)*sizeof(int)); double *b; b = (double*)malloc(array_size)*sizeof(double)); Then after the use of arrays free the memory by the following; free(a); free(b) ; For two dimensional array: For an array like a[ row_numbers ][ column_numbers ] int** a = malloc((row_nimbers) * sizeof(int*)); for (i=0;i<row_nimbers,i++) {     a[ i ] = malloc((column_nimbers)* sizeof(int)); }  Then after the use of arrays free the memory by the following; for(i = 0; i <row_nimbers; i++) {       free(a[ i ]);  }   For (C++ programming)   int* x = new int[ N

How to install Windows 8/Windows 8.1 and Fedora 20 (Heisenbug) in dual boot mode with EFI secure boot disabled

How to install Windows 8/Windows 8.1 and Fedora 20 (Heisenbug) in  dual boot mode with EFI secure boot disabled Hello world, with this new feature of UEFI (Unified Extensible Firmware Interface) boot on the latest motherboards, the installation of Linux OS has become a real pain. But here I am sharing an easy, short and fast way to install Linux (Fedora) OS on a Windows pre-installed machines. To install Linux on a Windows pre-installed machine follow the following steps: (1) Get the *.iso file of the latest issue of Fedora from here (2) Make a bootable DVD from brasero (or any software which can write an iso bootable DVD/CD) or you can also make a bootable USB with UNetbootin . (I specially prefer UNetbootin over start-up disk creator or live-sub-creator, since with UNetbootin you can make bootable usb of any OS, Windows, Fedora, Ubuntu etc.). (3) Disable the secure boot and fast boot for your machine. To know how to do this click here . (4) Now insert your bootable DVD

Print Hello world! in C programing

For "C-programming" How to print "Hello world!" type the following in the file "hello.c" #include<stdio.h> main( ) {  printf("Hello world\n"); } then do the following in the terminal: (1)  cd /path/to/hello.c (2) gcc hello.c  this will create an executable file " a.out " (3) Then run the executable file with:     ./a.out