MATLAB is a numerical computing environment and proprietary fourth-generation programming language. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, Fortran and Python. Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.

Hi,
I am trying to check integration using two different methods, first by using [function (int)] and second by using summation. I am integration from high to low values (0.1 to 0). I got same result. However, from function I got positive value (0.005) and from summation, negative value (-0.005). I am not sure if that because I am integrating from high to low values so I need to use (dr) in negative value when finding the integration using summation.

I used below code

clear all; clc; syms x y y = -x; z=int(y,x); v=[0:0.1/19:0.1]; dr=0.1/20; for i=1:20 x=v(i); kk(i)=eval(y)*(dr); end R1=sum(kk(1,:)); x=0.1; z1=eval(z); x=0; z2=eval(z); R2=z2-z1;

I am using MATLAB to solve equation using (syms) then evaluating the result. The program is working. However, each loop taking almost 23 second. Is there anyway that I can optimize program so it will work faster?

I used the below code

clear;clc;syms A B C D E ; R=((4*B*A)/((D-C)^2+(B+A)^2));R1=((4*B*A)/((D+C)^2+(B+A)^2));F1 = ellipticK(R);I1 = ellipticE(R);F2 = ellipticK(R1);I2 = ellipticE(R1);P= ((((A*B)^(1/2))/(2*E*(R^(1/2))))*(((2 - R)*F1) -... (2*I1)))-(((((A*B)^(1/2))/(2*E*(R1^(1/2)))))* ... (((2 - R1)*F2) - (2*I2)));P1=feval(symengine,'simplify',P,'IgnoreAnalyticConstraints');X=(1/B)*(diff(P1,D));X1=feval(symengine,'simplify',X,'IgnoreAnalyticConstraints');[B,D]= meshgrid(linspace(0.1,10),linspace(0.1,10));E=3;N1 = 10*rand(100000,1);N2 = 5*rand(100000,1);M(:)=0;for i=1:100000 tic A=N1(i);C=N2(i); F = matlabFunction(X1); B = F(A, B, C, D, E); In(:,:,i)=B(:,:); fprintf('%d\n ', i); tocend

I am very new to image processing and Matlab. I am working with RGB image and used SLIC algorithm to generate superpixel for an image. By using regionprops to calculate the superpixel properties.

[Rcounts binlocations]=imhist(ImageRED);
[Gcounts binlocations]=imhist(ImageGREEN);
[Bcounts binlocations]=imhist(ImageBLUE);
Q1: I have 48 superpixels with Counts(R,G,B channels) it is giving me 256*1 double(most of them are zero). Can anybody explain how to refine them to get each superpixel histogram?

Q2: How can I compare and calculate the distance between two specific superpixel histograms?

Any help is greatly appreciated. Thanks in advance

I have a covariance matrix and I am using Matlab's chol function for cholesky decomposition. However, since my matrix is not a positive definite matrix. I am getting an error. How can I figure out which correlations/covariances in the matrix are leading to the problem.

how i can apply fuzzy logic for this problem? Or is there any other technique i can use for my problem?

Input : parameter values Output : (1) OLTP , (2) DSS , (3) % of OLTP and % of DSS

I have to classify between 3 classes as OLTP, DSS and mix type. if my input matches with OLTP or DSS type it return crisp class. if it matches with mix type it returns the percentage of OLTP and DSS

How can i apply fuzzy logic for this problem? Or is there any other technique i can use for my problem?

Input : parameter values Output : (1) OLTP , (2) DSS , (3) % of OLTP and % of DSS

I have to classify between 3 classes as OLTP, DSS and mix type. if my input matches with OLTP or DSS type it return crisp class. if it matches with mix type it returns the percentage of OLTP and DSS.

Two vehicles update their position using latitude and longitude using .csv file. Plot the graph for two vehicles in a single graph to detect the collision.

I have attached the file of Matlab output. How to detect the intersection points red dots. Whenever it detect the red dot at intersection alert message should be displayed. curveintersectionsexample.png

As a part of my project, I want to encrypt user defined data using an unbreakable encryption algorithm. I have got one AES algorithm. But it accepts plaintext as
plaintext_hex = {'00' '11' '22' '33' '44' '55' '66' '77' ...
'88' '99' 'aa' 'bb' 'cc' 'dd' 'ee' 'ff'};
I am doing my project in matlab.

Question :You are to simulate the motion of a drunken sailor (i.e. a random walk problem). The sailor is standing at the middle of a pier on the shore side. The sailorâ€™s ship is directly across from him.The pier size is L paces long and W paces wide (i.e. the sailor starts at coordinates Â½ W, 0 and the ship is L paces away) and the ship stretches across the entire width of the pier.Due to the sailorâ€™s inebriated condition a straight walking path cannot be maintained. Each second the sailor attempts to take a step. There is a 25% chance that the sailor will go left, a 20% chance the sailor will go right, a 10% chance the sailor will stand still, and a 45% chance the sailor will go forward. Assume the sailor does not go backwards.If the sailorâ€™s position exceeds the dimensions of the pier (zero to W) they fall into the sea. If they make it to the other side they are safe at their ship.Write a Matlab program(script file) that takes L and W as user inputs. The motion of the sailor is then simulated. If the sailor falls into the sea an appropriate message should be output. If the sailor makes it to the ship the time and number of paces it took them should be output. For either case a plot showing the sailorâ€™s path should be made.
Hint: Use evenly distributed random numbers to determine what direction the sailor goes.

Hi, I am beginner in Matlab, need help or advise on how to do this? If i have 2 image in gallery (one basketball image and one badminton image)-Basketball.JPG/Badminton.JPG I created GUI. Then i am able to upload the one of the image. But how do i compare this upload image with the 2images in gallery. So that if uploaded image matches Basketball, it will display Basketball. and if uploaded image matches Badminton,it will display Badminton.

in the following code I'm searching for a match of indexes between 2 files , if I found a match take -6,6 elements from the 1st file .

I need to save the found data as (1,13) . (data ) array shows the elements as I print it when I run the code but after finishing executing only the last element is saved .

earFilename = 'EAR_v1.txt';stateFilename = 'output_close_tags_video_1.txt';% read EAR values earfile = fopen(earFilename,'r'); formatSpec = '%d %f %f'; sizeA = [3 Inf];earVector = fscanf(earfile, formatSpec, sizeA);earVector = earVector';% read state file statefile = fopen(stateFilename,'r'); formatSpec = '%d %*s'; sizeA = [1 Inf]; stateVector = fscanf(statefile, formatSpec,sizeA); stateVector = stateVector';% create a dataset containing framenumber, EAR, statedataset = [earVector, -1*ones(size(earVector,1),1)];% for each positive state, +-6 frame are marked as positivedata=[];for i = stateVector' rowNumber = find(dataset==i); for j = -6:6 data=(rowNumber+j); disp(data)

1) Matrix a[m][n] is obtained by multiplying signal with hamming window .
2) When I pass Matrix "a" as input to " fftw_plan plan = fftw_plan_r2r_2d(n, m,&a[0][0],&b[0][0], FFTW_REDFT10, FFTW_REDFT10, FFTW_ESTIMATE); "
I get the following error :
cannot convert â€˜long double*â€™ to â€˜double*â€™ for argument â€˜4â€™ to â€˜fftw_plan_s* fftw_plan_r2r_2d(int, int, double*, double*, fftw_r2r_kind, fftw_r2r_kind, unsigned int)â€™

How do I pass a matrix to DCT function using fftw3 ,which is declared as mentioned above .
PS :When I declared it as double a[m][n] = {//Enter the elements}; //when m =640 ; n = 645
It gives Segmentation fault
{Because of which I tried to define matrix a in heap as mentioned but when given to the dct function throws error .}

Can anyone kindly solve my issue .
Thanks in Advance.

So I was trying to convert my matlab codes to c++ codes .I was trying to compare the output of all the user defined function written in matlab and c++ . In terms of precision there was slight difference . Something like " 0.0822219583523415 " the output from matlab and " 0.082222" from c++ . I ignored such difference at first as the result was similiar to some extent .But when operations like DCT and IDCT is done on vectors with such difference in values , the output I obtained from matlab and c++ DCT /IDCT was very different .
How can I solve this problem ?

First of all thank you for your help in advance. My question is regarding Matlab and non-linear Least Square curve fitting in Matlab - in both I am not familiar with.

I have this type of data:

x = [600, 800, 1000, 1200, 1400]; y = [0, 02, 04, 0.7, 1];

The only problem I have is the starting value in sigfit variable. What would be the best starting values given the above numbers? Any help please would be extremely appreciated.

The X vector is time intervals in milliseconds, whereas the Y vector represents responses some participant made whether those intervals where perceived as close to a short (400ms) or long (1600ms) interval.

I don't understand what starting points mean. Ultimately what I need to do is find the 0.5 point in the Y axis and the corresponding value on the X axis. The solution will be somewhere between 600ms to 1400 ms and probably around the 1200ms mark. I have put the starting value as a vector from 600 to 1400 but, I have no idea whether that is right or what that means. I was hoping someone better equipped than me can help answer this problem precisely :).

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnectâ€™s one-click button

1) The MS Office I used for over 4 years was removed because W10 said that this "starter" office could cause damage.

2) Matlab starts up really fast. But when I enter a command and hit return, the command window gets stuck. In the admin account (which I rarely use), Matlab worked. (I will try re-installing it to see if that helps.) If you have any other suggestions other than reinstalling, I will give them a try.

I ran from the command prompt:
slmgr /xpr
and the popup said that Windows is permanently activated.

However I don't want to update the second bit of code every time the first changes. I was wondering if there's a way for the result to be automatically updated.

I would like to evaluate this result numerically eg typing f(2) and the previous result (2*exp(-x^2/2)) would evaluated at 2 giving 0.2707
I could copy paste the previous result and make a a function like this, but I would prefer it to be automatic, otherwise I have to copy paste every time the original function changes.

I need to implement the equation in attached picture in matlab. It involves 2 summations from 0 to infinity and bessel functions, and I am not sure if I am doing it correctly. Below is my code for the summations. The results I get for the final C value of the whole equation seem reasonable. However, I am questioning my implementation because I have to break out of the loop when my bessel functions evaluate to too large or small. I was wondering if anyone can comment on that, thank you.

sumn = 0;
sumnP = inf;
n = 0;

while abs(sumnP - sumn) > 1e-16
% m-summation
summ = 0;
summP = inf;
m = 0;
while abs(summP - summ) > 1e-16
summP = summ;
if besseli(2*m+1,(2*n+1)*pi*a/L) ~= 0
summ = summ + (cos(2*m+1)*ksi*cos(2*m+1)*delta/((2*m+1)^2))...
*besseli(2*m+2,(2*n+1)*pi*a/L)/besseli(2*m+1,(2*n+1)*pi*a/L);
else break
end
m = m + 1;
if isnan(summ)
summ = summP; break;
end
end
sumnP = sumn;
sumn = sumn + (-1)^n*sin((2*n+1)/2)*(pi*len/L)*summ;
end equation.jpg

I am using MATLAB 2009,I have a micro-structure image and I transformed into greyscale image and then to BW. Now I want to know the number of pixels along the scale bar (scale bar width is one pixel size), in order to calculate grain size. Please help me to find out How many pixels in the line of specified length with constant width of pixel size. using MATLAB. or suggest me other way to find the grain size from the microstructure image.
Thank you in Advance.

MATLAB is a numerical computing environment and proprietary fourth-generation programming language. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, Fortran and Python. Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.