Hello, I'm new in matlab. Can someone help me on how to conduct Hooke-Jeeves direct penalty technique in Matlab? I'm trying to solve optimisation problem of data fitting between experiment and simulation result.
[link] [comments]
Hello, I'm new in matlab. Can someone help me on how to conduct Hooke-Jeeves direct penalty technique in Matlab? I'm trying to solve optimisation problem of data fitting between experiment and simulation result.
I'm trying to write Matlab code to solve my thermodynamics problems, I have come across MatlabMarina thermodynamics but unfortunately couldn't get that GUI or any of the functions to work so I'm trying to do it from scratch. Please if anyone has a clue on this topic if there is a way to setup a bank of solvers like a compressor solver and a pump or whatever solver and then be able to put these pieces together to form a closed loop system to workout all the states of the fluid going through the system. Also wondering if I can make it plot PV, TS or PH graphs . Or if someone can just help me install matlab Marina functions correctly and possible give a run down on how to use it usefully in a system because the only tutorial I've seen is how to set water to be a saturated liquid.
Tldr Is it possible to make a thermodynamics question solver?
i want to convert a pricture to RGB matrix with 5 column that show each pixel to [ i , j , R,G ,B] but i dont know how can i do it ?
Hello! I am looking for a way to tell what operations were used when I use the command to convert a matrix to echelon form. The ultimate reason is I want to determine the determinant by multiplying the diagonals as it will be an upper triangular matrix. So I need to know if a row was interchanged for example, or if scaling was used so that I can change the now reduced determinant to the original determinant. I am aware that you can just use a determinant function but I am not looking to do it that way. Thanks!
Hello. I don't have experience with matlab and I need to convert a matching algorithm, it's a deferred acceptance algorithm, from 1 to 1, to many to 1.
I want to pay someone to do it.
You guys can help me with it, or tell me where i can find someone who can do it?
Hi guys!
My name is Marco and I’m a dating coach. I help busy professionals in their dating lives.
I am always trying to get to know my audience a little more, that’s why I ask you the following:
As experts in design and simulation, what are the challenges you are facing in your dating lives ?
Thanks!
I created the bilinear function in matlab using lagrange interpolation. It works fine but I cant figure out how to input values (of x and y) into the function.
the function:
would appreciate any help
Hello everyone, first time posting in this subreddit, but I have been banging my head against the wall trying to solve this issue I am having. When I use the streamslice function to plot my electric field lines for a tiny parallel plate capacitor I get lines that either doesn't start on a plate or end on a plate which looks bad if this is to be a published plot. You can see what I mean in the attached image. any suggestions on how to fix it?
I don't want to use quiver (unless I can make it look like streamslice with connecting lines) and streamlines function does not work too well.
Hey there guys,
I'm currently trying to generate the groundtruth data for training a faster Rcnn object detector on matlab. I'm using the image labeller app to create an ROI label around the license plate of my images as that is what I am trying to detect. So what I'm asking is if it is possible to rotate the rectangle of ROI label definition at Image Labeler, in order to define the exact object and not superfluous information around of it. Rotating every single image (I have to process over 4,000 images) at different angles and redefine the object is time-consuming.
Hey I am trying to create an anonymous matlab function for the maclaurin expansion of log(x+1). I've tried a few different ways, so far I'm at a for loop
apx=@(x,n) 0;
for i=1:n
apx = apx + ((-1)^(n+1)).*((x.^n)/n);
end
My main issue is getting the all of the terms to sum at the end to get an accurate approximation, can someone tell me what I'm doing wrong?
Hello everyone,
I am currently trying to create a program that automates the manual guessing process. I am currently trying to find the constants (mu_max, Ks, and Ycs). The paper I am studying gives me bacterial growth data (that I plotted in red dash lines) and the paper confirms that the bacteria follow the two differential equations shown below.
I have 3 functions set up that allow me to input guesses for my growth constants (mu_max, Ks, and Ycs) and someone from this forum was nice enough to create a way to estimating the error of the constants vs. the raw data. The constants are used with ode45 to create two lines (solid red and blue) and I am using those to show how well my constants work to fit the raw data.
However it is really tedious to manually insert these values and guess. The guesses are inserted into the vector called "params0" and a vector "params" outputs better guess. nErr is also displayed to show the norm between the calculated data points and the raw data.
Does anyone know an efficient way of having matlab loop guesses into parmas0, fix the guesses based on the output of params until the guess has an nErr of 1? I could brute force it with rand but I'm sure there is a more efficient way. Here is the code I have so far. Thank you to everyone who has helped me on this forum. I wish I was back on campus to ask my prof, so sorry to keep bothering!
% This is the program I run function growthSim() % Get testing data: dVals at time values tVals tVals = [0 10 18 25 33 37 40 44 50]; dVals = [0.5 1 1.5 2.9 5.5 11.4 16.3 19.2 20.9; 50 48.5 45.2 38.8 24 11.8 4.5 0.3 0]'; plot(tVals,dVals,'--r','LineWidth',2) hold on % Given test data, optimize ode parameters to minimize the error % between the data and the ode simulation % Initial Guesses...how do I automate this??? params0 = [0.0974,3.76,0.4036]; [params,nErr] = fminunc(@(p)costFun(p,tVals,dVals),params0) C0 = [0.5 50]; muMax = params0(1); Ks = params0(2); Ycs = params0(3); [~, sVals] = ode45(@(t,x)SYS(t,x,muMax,Ks,Ycs),tVals,C0,0.01); plot(tVals,sVals) end % These two programs are saved in the same folder function nErr = costFun(params,tVals,dVals) C0 = [0.5 50]; muMax = params(1); Ks = params(2); Ycs = params(3); [~, sVals] = ode45(@(t,x)SYS(t,x,muMax,Ks,Ycs),tVals,C0,0.01); nErr = norm(sVals-dVals); end % Initializing the differential functions function dC = SYS(~,y,muMax,Ks,Ycs) % Defining our independent and dependent variables % t = time % y(1) = Cell Cocentration, X % y(2) = Substrate Concentration, S % muMax = 0.0974; % h^-1 % Ks = 3.76; % g/L % Ycs = 0.4036; % Defining the functions of change over time. dC = [ (muMax*y(2)*y(1))/(Ks+y(2)) -(muMax*y(2)*y(1))/((Ks+y(2))*Ycs) ]; end
Please let me know if you need anymore information!
Hello everyone I just want you to suggest me courses to learn matlab. I am a sophomore electrical engineering student and I have a little background about C language and python. I’ve taken the tutorial in the website and it was quite helpful but it does not give me The deep with in the fluency that I need.
Also the code was working fine on my friend laptop but as i tried to publish on my pc, there was this error. Anyone know about it. Need help!
Definition of variables:
y := [3xn]
A := [3x3] // depending on variable k stored in a [nx1] vector
x := [3xn]
I am aware of bsxfun, but that is only working with two variables, right?
But also then I‘d need to define a function f(k,x1,x2,x3) and call something like
y = bsxfun(f,k,x(1,:),x(2,:),x(3,:));
Which feels overly complex for a standard equation like this.
Currently I am solving it with a for-loop but it feels like I just haven’t found the right function.
Sorry for the poor formatting, I am on mobile currently.
I have successfully converted my MATLAB code to an executable on my local Windows PC. However, without using libraries such as LAPACK and BLAS, the executable is extremely slow due to the large amount of linear algebra computations involved. I was shocked to find out that codegen doesn’t just automatically use these libraries— I have to write some backend myself!
Let’s look at LAPACK. I found this link telling me I need to write this class for codegen. https://www.mathworks.com/help/coder/ug/generate-code-that-calls-lapack-functions.html However, the problem is that modifying this template requires some knowledge of how these backend things work, which is way out of my comfort zone as a math student. I found the libmwlapack.lib and lapacke.h files in matlabroot/extern on my Windows PC that can be used as the LAPACK library/header to link to, but since the executable is meant for a Linux cluster (Slurm), how should I modify the template so that the path is correct for that? The ‘pwd’ in the template is definitely not gonna work.
This also seems like a very clunky way to do something conceptually really simple. And I would much prefer to generate this executable on my local machine. I know that for ‘mex’ you can just use the flag ‘-lmwlapack’ and ‘lmwblas’ and voila. But ‘mex’ won’t give me an executable. Is there a simple way similar to that but produces an executable? Thank you so much for your help!
Hi! I'm currently preparing for my master thesis in which I will be conducting surveys for research concerning MATLAB and many of its features. Therefore, one of the target populations for my surveys will be the MATLAB community, so I was wondering if:
Any feedback would be very very helpful. Thanks in advance!
I want to solve variable M3 with respect to variable A ( and it seems like I did it!) and I want to display to the screen like this: "M3 = 3.49A" not the whole fraction thing! I tried to use fprintf ('M3= %.2f * A ', M3) and there was error :(( Can anyone help me please, i am really close to finish this homework. I really appreciate your help and Thank you in advance!
Here is my code: https://pastebin.com/MU1vTpeW
this is my dynamic:
( i used ''ureal'' but in matlab function didn't defined)
Hey guys, I trained a fasterRCNN object detector for the purpose of detecting license plates; on 36 images as a quick test run. Then when I tested the detector it didn't even show a bounding box around the license plate on any of the 10 images I tested on it.
This is the code I have used so far:
trainingData = gTruth
imDir = fullfile ('C:\Users\charl\OneDrive\Desktop\Andis Stuff\GithubProject\Testing\LP Images');
rng(0);
shuffledIdx = randperm(height(trainingData));
trainingData = trainingData(shuffledIdx,:);
options = trainingOptions('sgdm', ...
'MiniBatchSize', 1, ...
'InitialLearnRate', 1e-6, ...
'MaxEpochs', 5);
detector = trainFasterRCNNObjectDetector(trainingData, layers, options)
img = imread('lptest2.JPG');
Run detector.
[bbox, score, label] = detect(detector, img);
Display detection results.
detectedImg = insertShape(img, 'Rectangle', bbox);
figure
imshow(detectedImg)
Where would you say I went wrong:
training dataset too small?
mini epoch size too small?
(I set it to 1 as I had images of different sizes and was worried if the resolution was to small it wouldn't be able to detect the license plate at all)
training options configured poorly?
Ground truth data configured poorly?
Or mabe the ROI labels on the image labeller app need to be more tight?
Any suggestions to fix this detector would be immensley appreciated.
I have a table 2000x1 that I need to delete alla the numbers that are bellow 10) with an array I can simply write B=a(a>10) but when i try to do this with a table I can't.