Tuesday, December 8, 2015

how to install matlab 2015b?

hi friends.. now a days we are using MATLAB software for simulation and research environment. here i given procedure for MATLAB software installation..
Step 1: Start the Installer
1.      Copy the products files (including the installer file) to your computer or an accessible location (for example, a DVD, USB drive, or network share).
2.      Start the installer. The method you use to start the installer depends on your platform and whether you are accessing previously downloaded product files or are using a DVD,.
·         Windows
o    Previously downloaded product files — If you or an administrator downloaded the product files previously and copied the product files to your computer, a network share, or to media, go to the top level of the folder where the product files are located and click setup.exe.
o    DVD installation — Insert the DVD into the DVD drive connected to your system. The installer usually starts automatically.
·         Mac OS X
o    DVD installation — Insert the DVD into the DVD drive connected to your system. When the DVD icon appears on the desktop, double-click the icon to display the DVD contents, and then double-click the InstallForMacOSX icon to begin the installation.

o    Previously downloaded product files — If you or an administrator downloaded the product files and copied the extracted files to your computer, a network share, or to media, go to the top level of the folder where the product files are located and double-click the InstallForMacOSX icon to begin the installation.
·         Linux
o    Previously downloaded product files — If you or an administrator downloaded the product files and copied the extracted files to your computer, a network share, or to media, go to the top level of the folder where the product files are located and execute the installer command:
o    ./install
o    DVD installation — Insert the DVD into the DVD drive connected to your system and execute this command:
/path_to_dvd/install &
Depending on how your system is configured, you might have to mount the DVD first. Make sure you mount it with execute permissions, as in the following example. Note that the name of the DVD drive might be different on your system.
mount -o exec  /media/cdrom0

Step 2: Install With a File Installation Key

If you do not have an Internet connection, but have access to product files on your computer, a network share, or a DVD, select the Use a File Installation Key option and click Next.


Step 3: Review the License Agreement

Review the software license agreement and, if you agree with the terms, select Yes and click Next.

Step 4: Specify the File Installation Key

If you do not have an Internet connection, and choose to install manually, the installer displays the File Installation Key dialog box. A File Installation Key identifies the products you can install.
If you have the key, select the I have the File Installation Key for my license option, enter the File Installation Key, and click Next. The administrator contact on a license can retrieve the File Installation Key from the License Center at the MathWorks website.
If you do not have the key, select the I do not have the File Installation Key option and click Next. The installer provides you with the information you need to get a key.


If You Do Not Have the File Installation Key

The Installation and Activation Next Steps dialog box contains the information you need to retrieve your File Installation Key from the License Center at the MathWorks website. This information includes:
·         Host ID
·         Release number (for example, R2015b)
·         Operating system user name (Note that user names are case-sensitive in activation.)


To get your File Installation Key:
1.      Copy the information displayed in this dialog box and click Finish to exit the installer. On Windows and Linux systems, you can click Print to print the information.
2.      Go to a computer with an Internet connection and log in to your account at the MathWorks website.
3.      Visit the License Center and enter the information from this dialog box. MathWorks uses this information to generate a License File and a File Installation Key for your license.
4.      Return to your computer and run the installer again. With the File Installation Key and a License File, you can install and activate the software without an Internet connection.

Step 5: Specify the Installation Folder

Specify the name of the folder where you want to install MathWorks products. Accept the default installation folder, or click Browse to select a different one. If the folder does not exist, the installer creates it.
When specifying a folder name, you can use any alphanumeric character and some special characters, such as underscores. If you make a mistake while entering a folder name and want to start over, click Restore Default Folder. After making your selection, click Next.


Step 6: Specify Products to Install

Specify which products you want to install in the Product Selection dialog box. This dialog box lists all the products associated with the license you selected or with the Activation Key you specified. In the dialog box, all the products are preselected for installation. If you do not want to install a particular product, clear the check box next to its name.
After selecting the products you want to install, click Next to continue with the installation.


Note:   If the product files are not located on your computer or the installer is not located in the same folder as the product files, the installer will be unable to find products to install.

Step 7: Specify Installation Options

You can specify several installation options, depending on your platform.

Windows Systems

On Windows, the Installation Options dialog box lets you choose whether to put shortcuts for starting MATLAB in the Start menu and on the desktop.
After selecting installation options, click Next to proceed with the installation.
ok.. we will see you with new idea...


How to remove noise in iMAGE using MATLAB?

hi... Today we are going to learn about removing Noise in Image using MATLAB.
            Digital images are prone to a variety of types of noiseNoise is the result of errors in the image acquisition process that result in pixel values that do not reflect the true intensities of the real scene. There are several ways that noise can be introduced into an image, depending on how the image is created. For example:
  • If the image is scanned from a photograph made on film, the film grain is a source of noiseNoise can also be the result of damage to the film, or be introduced by the scanner itself.
  • If the image is acquired directly in a digital format, the mechanism for gathering the data (such as a CCD detector) can introduce noise.
  • Electronic transmission of image data can introduce noise.
To simulate the effects of some of the problems listed above, the toolbox provides the imnoise function, which you can use to add various types of noise to an image. The examples in this section use this function.

Remove Noise By Linear Filtering:

You can use linear filtering to remove certain types of noise. Certain filters, such as averaging or Gaussian filters, are appropriate for this purpose. For example, an averaging filter is useful for removing grain noise from a photograph. Because each pixel gets set to the average of the pixels in its neighborhood, local variations caused by grain are reduced.
See What Is Image Filtering in the Spatial Domain? for more information about linear filtering using imfilter.
EXAMPLE:
Read a color image into the workspace and view it.
originalRGB = imread('peppers.png');
imshow(originalRGB)
                                Fig:Original Image
Create a filter, h, that can be used to approximate linear camera motion.
h = fspecial('motion', 50, 45);
Apply the filter, using imfilter, to the image originalRGB to create a new image, filteredRGB.
filteredRGB = imfilter(originalRGB, h);
figure, imshow(filteredRGB)
Fig:Filtered Image

Remove Noise Using Median Filtering

This example shows how to remove salt and pepper noise from an image using an averaging filter and a median filter (medfilt2) to allow comparison of the results. Median filtering is similar to an averaging filter, in that each output pixel is set to an average of the pixel values in the neighborhood of the corresponding input pixel. However, with median filtering, the value of an output pixel is determined by the median of the neighborhood pixels, rather than the mean. The median is much less sensitive than the mean to extreme values (called outliers). Median filtering is therefore better able to remove these outliers without reducing the sharpness of the image. Median filtering is a specific case of order-statistic filtering, also known as rank filtering. For information about order-statistic filtering, see the reference page for the ordfilt2 function.
Example:
Read image and display it.
I = imread('eight.tif');
imshow(I)
FIG:Input Image

For this example, add salt and pepper noise to the image. This type of noise consists of random pixels being set to black
or white (the extremes of the data range).
J = imnoise(I,'salt & pepper',0.02);
figure, imshow(J)
Fig:Salt & Pepper Noise added Image
Filter the noisy image with an averaging filter and display the results. The example uses a 3-by-3 neighborhood.
K = filter2(fspecial('average',3),J)/255;
figure, imshow(K)
Fig: Noise Removed image
Now use a median filter to filter the noisy image and display the results. The example uses a 3-by-3 neighborhood. Notice that medfilt2 does a better job of removing noise, with less blurring of edges.
L = medfilt2(J,[3 3]);
figure, imshow(L)
Fig: Noise Removed by Median Filter


Remove Noise By Adaptive Filtering:

The wiener2 function applies a Wiener filter (a type of linear filter) to an image adaptively, tailoring itself to the local image variance. Where the variance is large, wiener2 performs little smoothing. Where the variance is small, wiener2 performs more smoothing.
This approach often produces better results than linear filtering. The adaptive filter is more selective than a comparable linear filter, preserving edges and other high-frequency parts of an image. In addition, there are no design tasks; the wiener2 function handles all preliminary computations and implements the filter for an input image. wiener2, however, does require more computation time than linear filtering.
wiener2 works best when the noise is constant-power ("white") additive noise, such as Gaussian noise. The example below applies wiener2 to an image of Saturn that has had Gaussian noise added.
1.Read in an image. Because the image is a truecolor image, the example converts it to grayscale. 
RGB = imread('saturn.png');

I = rgb2gray(RGB);
2.The example then add Gaussian noise to the image and then displays the image. Because the image is quite large, the figure only shows a portion of the image.
J = imnoise(I,'gaussian',0,0.025);
imshow(J)
Fig:Portion of the Image with Added Gaussian Noise
3.Remove the noise, using the wiener2 function. Again, the figure only shows a portion of the image
K = wiener2(J,[5 5]);
figure, imshow(K)
Fig:Portion of the Image with Noise Removed by Wiener Filter
Thank you... will see you with next interesting topic....




Monday, November 23, 2015

Sampling a Signal using Matlab

SAMPLING:
The matlab code for sampling of sinusoidal signal shown in below..
clc;
clear all;
close all;
fs=500e3; %Very high sampling rate 500 kHz
f=10e3; %Frequency of sinusoid
nCyl=5; %generate five cycles of sinusoid
t=0:1/fs:nCyl*1/f; %time index
x=cos(2*pi*f*t);
figure,
 plot(t,x)
title('Continuous sinusoidal signal');
xlabel('Time(s)');
ylabel('Amplitude');
fs1=30e3; %3kHz sampling rate
t1=0:1/fs1:nCyl*1/f; %time index
x1=cos(2*pi*f*t1);
 fs2=50e3; %5kHz sampling rate
t2=0:1/fs2:nCyl*1/f; %time index
x2=cos(2*pi*f*t2);
figure,
subplot(2,1,1);
%plot(t,x);
stem(t1,x1);
title('Sampling Continuous sinusoidal signal at f1=3kHz');
xlabel('Time(s)');
ylabel('Amplitude');
%hold on;

subplot(2,1,2);
%plot(t,x);
stem(t2,x2);
title('Sampling Continuous sinusoidal signal at f2=5kHz');
xlabel('Time(s)');
ylabel('Amplitude');
hold on;

OUTPUT:


See you with next tutorial.....

HOW TO READ IMAGE FROM FILE USING MATLAB?

Read Image and Display:

Read image from file and display, we have to type this code in matlab and run..
clc;
clear all;
close all;
[FileName,PathName] = uigetfile('*.jpg','Select the IMAGE file');
I=imread([PathName,FileName]);
% I=imresize(I,[256 256]);
imshow(I);
title('Input Image');

THE OUTPUT RESULT:

Sunday, November 22, 2015

CROP iMAGE using MATLAB

Read image into the workspace.
          I = imread('cameraman.tif');
Open Crop Image tool associated with this image. Specify a variable in which to store the cropped image. The example includes the optional return value rect in which imcrop returns the four-element position vector of the rectangle you draw.
         [I2, rect] = imcrop(I);
When you move the cursor over the image, it changes to a cross-hairs . The Crop Image tool blocks the MATLAB command line until you complete the operation.
Using the mouse, draw a rectangle over the portion of the image that you want to crop.
Perform the crop operation by double-clicking in the crop rectangle or selecting Crop Image on the context menu.
The Crop Image tool returns the cropped area in the return variable, I2. The variable rect is the four-element position vector describing the crop rectangle you specified.
now we can see the crop image by type the commend 
                                               imshow(I2);


see you with next interesting idea....