Code Snippets MATLAB

Short texts MATLAB 🧑‍💻 Code snippets MATLAB ✍️ Reading lists MATLAB 👀

kinetic.m

function output = kinetic(mass, velocity) output = 1/2*mass*velocity.^2;

Arrhenius.m

%% Define the variables Q = 8000; % cal/mol R = 1.987; % cal/mol K kz = 1200; % min^-1 T = 100:50:500; % range: 100 K ~ 500 K, step: 50 %% A rate constant k when range: 100 K ~ 500 K, step: 50 k = kz.*exp(-(Q./(R.*T))); % min^-1 %% Results my_results = […]

ThreeBinaryClassifiers.m

function ThreeBinaryClassifiers() % load fisheriris data load fisheriris meas species; X = meas(:, 3 : 4); y = species; % train SVM models for 3 binary classifiers SVMModels = cell(3, 1); classes = unique(y); for j = 1 : numel(classes) index = strcmp(y, classes(j)); SVMModels{j} = fitcsvm(X, index, ‘KernelFunction’, ‘gaussian’, ‘BoxConstraint’, 1000); end % calculate […]

epipolar_geometry.m

clear all; close all; clc; PTS1 = load(‘pts2D_1.txt’); % 300 x 2 matrix PTS2 = load(‘pts2D_2.txt’); % 300 x 2 matrix tmp = ones(length(PTS1),1); Homogenous_PTS1 = [PTS1, tmp]; Homogenous_PTS2 = [PTS2, tmp]; % 300 x 3 matrix (z axis = 1 for each) matches = [PTS1, PTS2]; % 300 x 4 matrix. Firs two row […]