Blog Archives
Simple Approach to (Without) SVM Algorithm (Create Hyperplane Base Regression Of Closest Pair)
Hi All Student, we apologize for the delay in posting “Sentiment Analysis Document Using Support Vector Machines (SVMs) With Linier & Polynomial Kernel Without Matlab ToolBox” . But it’s okey. đ
In this week we will provide an overview of a technique which it’s think is a very simple approach to be implemented in making comparisons with the results hyperplane formed of Support Vector Machine (SVM) on linear data to separate the two classes (binary classification), based Linear Regression method on nearest points (Closest Pair) is formed of two points between classes to take its midpoint. Obviously this method is very vulnerable to errors in the formation of the hyperplane line, because they do not have a concept of Support Vector, in the sense that all points are considered all result of midpoint or it’s just take few of midpoint.
This is the linear regression formula (y = a + b*x) :
Tracking animation base Closest Pair :
View results part 1 :
View results part 2 :
View results part 3 :
View results part 4 :
You can download This Matlab Code All About âSimple_Approach_Hyperplane_Of_SVM_Base_Regression_Closest_Pairâ at (Simple_Approach_Hyperplane_Of_SVM_Base_Regression_Closest_Pair.zip). Note : âAfter Download it, To Extract File (Simple_Approach_Hyperplane_Of_SVM_Base_Regression_Closest_Pair.zip), You must Rename Extension *.doc to *.zipâ
To Running the program, double click Simple_Approach_Hyperplane_Of_SVM_Base_Regression_Closest_Pair.m file. Enjoy with matlab code, especially for your research.
Any Suggestions, Question and Other, Send to My Email : matlabfreecode@gmail.com
(CMIIW & PMIIW).
Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 5]
In the fifth section coincides with 5 till 7 day before Eid and holiday period at home in my village until the 11th of August 2013 to connect silaturrahmi / kinship relations and longs to be with both parents and my siblings. Alhamdulillah, I feel very happy and peaceful can be meeting them. This seems similar to the story when I heard the song of “Michael BublĂ© – Let me go home”. hehe .. đ , Okey all student and people in the world, now we will share how to run the file from the deploy results *.m to *.java using Eclipse (How to run all files *. Java in the folder â..\MyProject_Java_Application\src\myProject_Java_Applicationâ and file *.ctf in folder â..\MyProject_Java_Application\src\classes\myProject_Java_Applicationâ in Eclipse). We use Eclipse Indigo & Matlab 2009 and hope you can develop to recently version on both. đ Let’s go the developer :
- Installs Eclipse, then run on your computer.
- Set “Workspace” on the folder that we want. Then click “OK” button.
- Display “Welcome” page in Eclipse.
- Click “File” and then click “New”, then click “Java Project”.
- Create a new project, for example with the name “OsteoMeter”, then click the “Finish” button.
- Click the “Minimize” button on the “Welcome” page to see the Eclipse Project form of “OsteoMeter”.
- Copy Folder “myProject_Java_Application” in folder “.. \ MyProject_Java_Application \ src”
- Then Paste in the folder where we store the Eclipse Project “OsteoMeter”. For example in the folder “D: \ Master \ EclipseProject \ MyWorkspace \, then look for the folder” D: \ Master \ EclipseProject \ MyWorkspace \ OsteoMeter \ src “.
- Display after the process of Paste is done.
- Copy the file *. ctf in the folder “.. \ MyProject_Java_Application \ src \ classes \ myProject_Java_Application”
- Paste it in the folder “D: \ Master \ EclipseProject \ MyWorkspace \ OsteoMeter \ src \ myProject_Java_Application”.
- Display after the process of Paste is done.
- Back to the Eclipse Project, right click on the Project “OsteoMeter”, then click “Refresh”.
- It will show all files “.java” and “.ctf” which has been incorporated and there is appear error.
- Enter the library “javabuilder.jar” to eliminate the errors that are marked with red color on some files “.java” in the Eclipse Project.
- Right-click the Project “OsteoMeter”, then click “Build Path”, then click “Configure Build Path …”, then select the “Libraries” tab.
- Click âAdd External JARsâŠâ button.
- Select the file “javabuilder.jar” then click “Open”.
- Click the “OK” button.
note : take library âjavabuilder.jarâ at âC:\Program Files\MATLAB\MATLAB Compiler Runtime\v710\toolbox\javabuilder\jar\javabuilder.jarâ. this directory of javabuilder may be different from those in your computer. Because this directory of javabuilder accordance with the directory where we install file âMCRInstaller.exeâ. So take this file javabuilder corresponds to that of in your computer.
- Display Project File “OsteoMeter” which has been equipped library “javabuilder.jar”.
- Set “MyProject_Java_Application.java” as the Main-Class Project by right clicking “OsteoMeter”, then click “Run As”, then click “Run Configuration ..”.
- Click the “Java Application”, then click the “New launch configuration” (), eg “Name: Run As OsteoMeter”. Select Project by clicking the “Browse …”, eg “Project: OsteoMeter”, then click the “Search” in the “Main class:”.
- Select “MyProject_Java_Application” as the Main-Class, then click “OK”.
- Click the “Apply”, then click “Run”. Wait a few moments until the interface is appear, and it close automatically.
- Edit the file .java which is a Main-Class, the “MyProject_Java_Application.java”
Seek script âmcr.dispose();â by pressing the button âCTRL+Fâ then type with keyword âmcr.dispose();â then change become â//mcr.dispose();â then pressing save button.
- Project running process “OsteoMeter” doing by right-clicking Project “OsteoMeter”, then click “Run As”, then click ().
- Select “MyProject_Java_Application”, then click “OK”.
- The project “OsteoMeter” can be running with other way, by click the black arrow button that down direction.
Then click “()” that has been set as caller Main-Class in the previous section, so that the Form “Select Java Application” is used to select the file .java with manually way. It’s a Main-Class (file. java that first executed while running the process) doesn’t show up again. - Project “OsteoMeter” is being compiled. Wait a few seconds until the interfaces is appear.
- Display after Running result of deploy file *.m to *.java on Eclipse without Matlab.
note: if interface display the results of running only appears a few seconds (automatic exit). The solution is on the section “Edit file .java which is Main-Class”. Maybe you are not yet looking for a script “mcr.dispose();” by pressing “CTRL + F” and then type keyword “mcr.dispose();” then change it to “/ /mcr.dispose();” and press save button.
- Congratulations, youâve been success to Running result of deploy file *.m to *.java on Eclipse without Matlab.
- Finish. đ
Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 4]
In the fourth section coincides with the month of Ramadan, we will share how to run the file from the deploy results *.m to *.java using Netbeans (How to run all files *. Java in the folder â..\MyProject_Java_Application\src\myProject_Java_Applicationâ and file *.ctf in folder â..\MyProject_Java_Application\src\classes\myProject_Java_Applicationâ in NetBeans). We use Netbeans IDE 7.0.1 & Matlab 2009 and hope you can develop to recently version on both. đ Okey, Let’s go the developer :
- Installs Netbeans, then run on your computer.
- Click âFileâ, then Click âNew Project…”
- Choose âCategoriesâ [Java] and âProjectsâ [Java Application], then click â Next > â button
- Create new Project e.g. with name âOsteoMeterâ, uncheck at âCreate Main Classâ and âSet as Main Projectâ, then click âFinishâ button.
- Copy Folder âmyProject_Java_Applicationâ into Folder â..\MyProject_Java_Application\srcâ
- Then Paste into Folder where we save Project of NetBeans âOsteoMeterâ. E.g at folder âD:\Master\NetBeansProject\â, so then seek folder âD:\Master\NetBeansProject \OsteoMeter\srcâ.
- Display after Paste folder process is done.
- Copy file *.ctf at Folder â..\MyProject_Java_Application\src\classes\myProject_Java_Applicationâ
- Paste into Folder âD:\Master\NetBeansProject\OsteoMeter\src\myProject_Java_Applicationâ.
- Display after Paste file *.ctf process is done.
- Back to NetBeans Project, display when all file â.javaâ and â.ctfâ has been included. It’s will be seen there is an error.
- Include library âjavabuilder.jarâ to eliminate errors marked in red on some files of â*.javaâ :
- Right click âLibrariesâ
- Click âJAR/FolderâŠâ
- Choose file âjavabuilder.jarâ then click âOpenâ button.
note : take library âjavabuilder.jarâ at âC:\Program Files\MATLAB\MATLAB Compiler Runtime\v710\toolbox\javabuilder\jar\javabuilder.jarâ. this directory of javabuilder may be different from those in your computer. Because this directory of javabuilder accordance with the directory where we install file âMCRInstaller.exeâ. So take this file javabuilder corresponds to that of in your computer.
- Display File Project âOsteoMeterâ that has been included library of âjavabuilder.jarâ.
- Set âMyProject_Java_Application.javaâ as Main-Class, with do right click Project âOsteoMeterâ, then select âSet Configurationâ, then select âCustomizeâŠâ
- Click âBrowse..â button at field âMain Classâ. Then click âSelect Main Classâ button.
- Then click âOKâ button.
- Edit file .java which is Main-Class, namely âMyProject_Java_Application.javaâ
Seek script âmcr.dispose();â by pressing the button âCTRL+Fâ then type with keyword âmcr.dispose();â then change become â//mcr.dispose();â then pressing save button.
- âClean and Buildâ Project âOsteoMeterâ, by do right click Project âOsteoMeterâ, then pressing âClean and Buildâ.
- Display after âClean and Buildâ.
- Running Project âOsteoMeterâ with click Button ().
- Display after Running result of deploy file *.m to *.java on Netbeans without Matlab.
note: if interface display the results of running only appears a few seconds (automatic exit). The solution is on the section “Edit file .java which is Main-Class”. Maybe you are not yet looking for a script “mcr.dispose();” by pressing “CTRL + F” and then type keyword “mcr.dispose();” then change it to “/ /mcr.dispose();” and press save button.
- Congratulations, youâve been success to Running result of deploy file *.m to *.java on Netbeans without Matlab. đ
- To be Continue On [part 5]
Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 3]
In the third section. we will discuss about (Process deploy source code *.m into to .java and *.jar (Java Application)) : Compile Project “MyProject_Java_Application” by clicking “Build the project” Button (). Okey, Let’s Go Developer :
- If it appears (mbuild-setup), it means you do deploy for the first time, do the following:
- Click link (mbuild -setup)
- Type “y” without quotes and press “Enter”
- Type “1” without the quotes and press “Enter”
- Type “y” without quotes and press “Enter”
- Type “y” without quotes and press “Enter”
- Type “1”, then press “Enter”. Then type “y”, and press “Enter”
- Do it again Compile Project “MyProject_Standalone_Application” by clicking “Build the project” Button ()
- If appears display like below, it means you’ve done the compiler to deploy configuration settings before. Wait a while until the “Compilation in progress” is completed.
- Display when deployment is completed “Compilation completed” and if there is an error it will appear in red text.
The solution, check whether javac (java component) has been activated on your computer, see part 1. After that, close your MATLAB if still active, then open again your MATLAB. Open file “MyProject_Java_Application.prj” with form “Deployment Tool”. Do it again Compile Project “MyProject_Java_Application” by clicking “Build the project” ().
- If successful, then all the text in the “Deployment Tool Output” black.
- Results are deployed on the folder where the file “MyProject_Java_Application.prj” saved, e.g. on “C:\Users\……\Desktop\Source Code”.
note: folder “…\MyProject_Java_Application” is the same meaning as “C:\Users\……\Desktop\Source Code\ MyProject_Java_Application”.
- Content Folder “…\MyProject_Java_Application” :
- Content Folder : “…\MyProject_Java_Application\distrib” :
note: the file *. jar in the directory “…\MyProject_Java_Application\distrib” can not be run as independently, so it should run the “Build” process with NetBeans or the “Export” with Eclipse from all files existing java on folder
“…\MyProject_Java_Application\src\myProject_Java_Application”
and file. ctf that exist in folder “…\MyProject_Java_Application\src\classes\myProject_Java_Application”. - Content Folder : “…\MyProject_Java_Application\src\myProject_Java_Application” :
- Content Folder “…\MyProject_Java_Application\src\classes\myProject_Java_Application” :
- Content Folder “…\MyProject_Java_Application” :
- Congratulations, you’ve been success to deploy *.m into *. java and *.jar (Java Application) ! đ
- To be Continue On [part 4]
Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 2]
In this second part, Deploy source code *.m (Matlab) to .java and *.jar (Java Application) on Windows OS include : Run deploytool from the Command Window menu, then press “Enter” Or run deploytool menu from the Start button, and then click on “Deployment Tool (deploytool)”, and deploy process source code *.m to *.java and *.jar (Java Application). Let’s join steps below :
- Run deploytool from the Command Window menu, then press “Enter”.
- Or, run deploytool menu from the Start button, and then click on “Deployment Tool (deploytool)”.
- Form Display Deployment Tool.
- Click File> New Deployment Project Deployment Tool on the menu bar.
- Deploy process source code *.m to *.java and *.jar (Java Application).
- Rename Project and choose Location File Source Code, then click âOKâ.
- Display Form Compiler
- Include the only one main file *.m of “MyProject_Java_Application” with the click of a button ” “, then click the button “Open”.
- Results Include file at “MyProject_Java_Application”.
- Include all required files “MyProject_Java_Application” (Osteo.m) in the “Other files” with the click of a button ” “, then click the button “Open”.
- Save Project “MyProject_Java_Application” by clicking “save” ( ).
- To be Continue On [part 3]
Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 1]
Before doing the Deploy source code *.m Into. Java and. Jar, we first do the following tricks to enable MATLAB JA Builder (Java Application), Recommended minimal use Matlab 2009 :
- Install MCRInstaller.exe
(Take MCRInstaller file in folder :
“C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\win32\MCRInstaller.exe”)note: address MCRInstaller file “C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\win32\MCRInstaller.exe” may be different with your computer. Because this MCRInstaller file address matches the address of where we install Matlab. So take this MCRInstaller file as it is on your computer.
- Open cmd windows, and then check whether javac (java component) has been active on your computer with the command “javac-version” (without the quotes). If you have not done, then headed step 3.
- Open “Control Panel \ System and Security \ System” (If you are using Windows 7).
- Click âAdvanced system settingâ, then click âAdvancedâ tab,
- If you are using Windows XP. Open the “Control Panel”, then click “Performance and Maintenance” and then click “System”, then click the “Advanced” tab.
- Click the âEnvironment Variablesâ button.
- Find in the “System variables” that Variable named “Path”.
- Click the “Edit” button.
- Add the following value “;C:\Program Files\Java\jdk1.6.0_16\bin” (without quotation marks) in the Variable value. Then click the “OK” button.
note: value “;C:\Program Files\Java\jdk1.6.0_16\bin” could be different with your computer. Because the address of this value corresponds to the version we install jdk. So take this value According to the address you have in your computer.
note: Notice the text on the part that has a gray background color, the entire contents of the Variable value in the computer we have copy-paste it in Notepad ++, hopefully can be used as a reference. (Fill all the Variable value is only 1 line or 1 line only).
- Check javac version. Close cmd if it is still active, we open cmd windows again, then we type the command “javac-version” (without quotes) will display as shown below.
- Congratulation, javac (java component) has been active on your computer. đ
- To be Continue On [part 2]
Deploy .m (Matlab) to .exe (Standalone Application) On Windows OS [part 2]
In the second part, we will discuss about (Process deploy source code *.m into *.exe become Standalone Application) : Rename Project and select the Location File Source Code, Include one of the main file *.m on the “Main Function”, Include all the required files “Main Function” in the “Other files”, Save Project. Okey, Let’s Go To Follows This Step below :
- Rename Project and choose Location File Source Code, then click âOKâ
- Display Form Compiler
- Include one of the main file *.m on the “Main Function”, with click ““, then click “Open” button
- Result Include file On âMain Functionâ
- Include all the required files “Main Function” On the “Other files”, with click ““, then click “Open” button
- Save Project âMyProject_Standalone_Applicationâ with click “Saveâ () button
- To be Continue On [part 3]
Matlab is Relative to Said it as Instant Code or Not. Why?
This opinion is inspired by my dialogue with my lecturer about the programming language that should be used by students to learn to make coding to solve the problem some time ago. đ
Matlab is relative to said it as instant code or not. Why is that?
All of the following descriptions I addressed for all those who still hesitate to use Matlab as a programming language in homework, research, final project, thesis and dissertations in their respective institutions.
Here is some perspective from our experience of the Matlab programming :
1. Suitable for research.
Because it is a lot of modules or functions that have been provided and well as to accelerate in the manufacture of coding.
2. Matlab gives us flexibility.
That is how we make coding a module or function of our own making or using an existing function.
For example we can make the code to calculate the average value of the data rate without using the mean function that already exist in Matlab :
********************* Manual_mean_Vs_Fn_mean_Matlab.m *********************
clear all;
close all;
clc;
% Count mean of data
disp(‘=================================== ‘)
disp(‘Menghitung nilai rata-rata data ‘)
disp(‘=================================== ‘)
% enter number of data
byk_data=input(‘Input banyak data :’)
% initialization sum of data
jumlah_data=0;
% looping process
for i=1:byk_data
% retrieve the data entered
data_ke(i)=input(strcat(‘Input data ke -> ‘,num2str(i),’ = ‘));
% sum all data one by one
jumlah_data=jumlah_data+data_ke(i);
end
% Count mean of data without use function of matlab
Nilai_rata_rata_data_cara_manual = jumlah_data/byk_data
% Count mean of data use function of matlab
Nilai_rata_rata_data_dgn_Fn_matlab=mean(data_ke)
********************* Manual_mean_Vs_Fn_mean_Matlab.m *********************
The conclusion is :
If we want to develop or learn talents logic, then as much as possible we minimize the use of modules or functions or toolbox that already exist in Matlab. Even in all other program code, both C / C + +, C #, Java, Vb etc.
Any Suggestions, Question and Other, Send to My Email : matlabfreecode@gmail.com