Skip to main content

Posts

Showing posts from October, 2023

Stretch the dynamic range of the given 8-bit grayscale image using MATL...

why am I getting 'ugly' output?

  combinations_available=input(['Enter the number associated with the combination of salts available. Enter 0 if none of the combinations are available.'... '\n1:Two of these chlorides 1) NH4Cl(ammonium chloride) 2) MgCl2(magnesium chloride) 3) CaCl2(calcium chloride) 4) NaCl(sodium chloride) 5) KCl(potassium chloride) '... '\n2:ZnBr2(zinc bromide) & 1) NH4Cl(ammonium chloride) 2) MgCl2(magnesium chloride) 3) CaCl2(calcium chloride 4) NaCl(sodium chloride) 5) KCl(potassium chloride)'... '\n3:NH4Cl(ammonium chloride) & 1) CH3CO2K(potassium acetat) 2) ZnSO4(zink sulphate) 3) HCOONa(Sodium formate) 4) HCOOK(potassium formate)'... '\n4:ZnBr2(zinc bromide) & 1) CH3CO2K(potassium acetate) 2) ZnSO4(zink sulphate) 3) HCOONa(sodium formate) 4) HCOOK(potassium formate)'... '\n5:CH3CO2K(potassium acetate) & 1) NH4Cl(ammonium chloride) 2) MgCl2(magnesium

How to find the point of interception between the two lines?

  I have two y values, second and third columns in the attached matlab file. I am looking for the point of interception of the two lines. I have interpolated the two y values to get more sampling points (500 points). My goal is to find the integral of each line from the point of interception (where they both cross each othe and not at the origin; they cross around 200+ but I need a way to identify this point) to the end and compare them with the integral of the whole line. I tried to find the point where the two lines are exactly equal but that didn't work. The lines intercept but not the points. So, the closest point there in this case as other times they could meet is what I am looking for.     row = find(abs(x_untrt)==abs(x_untrt_s)); Thank you for the anticapated assistance.   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mecha

how to stop ode45 when one of states reach certain value

  [x_dot] =derivative(t, x)   x is states [x(1).....x(4)] I need to stop the integration when x(3) reaches 0.1 when the integration stop record (t)   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. Opt    = odeset('Events', @myEvent); [T, Y] = ode45(@YourFun, T, Y0, Opt); function [value, isterminal, direction] = myEvent(T, Y) value      = (Y(3) == 0.1); isterminal = 1;   % Stop the integration direction  = 0; SEE COMPLETE ANSWER CLICK THE LINK https://www.matlabsolutions.com/resources/how-to-stop-ode45-when-one-of-states-reach-certain-value.php

How do I extract the audiodata from a struct that I got from dir

  I have a folder with 100 wav files I need to iterate through and apply different functions to This is what I have so far   clear % Tester_object = audioread("Recordings\Speaker Female\Eendbekdier\f_ebd_1.wav"); % plot(Tester_object); dir("Recordings\Male Lump\"); audio_files = dir(fullfile("Recordings\Male Lump\", '*.wav')); for i=1:height(audio_files) name = audio_files(i).name; Tester = audioread(name); % This is the line that is not working that I don't know how to fix %-------- Functions applied in this square to 'Tester' % FFT % Frequency spectrum bands % Comparator %-------- These are all sorted end I just need to know how do I get the audiodata from within the struct that is created by dir(fullfile.....   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, E

Why can't I make a boxplot with data overlay?

  Here we go... So, I have the following boxplot, the values on the X-axis are spaced by 1, which is fine and I understand why, but I need to find a way to do the same boxplot, but with each box at its own value and scale even if there is box overlaps. Is there a way to do this?       NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. The following is an example:   % Sample data x = [ones(100,1); 2*ones(100,1); 4*ones(100,1)]; y = rand(300,1)+x; % Draw box plot for each x-value position figure boxchart(x,y)   SEE COMPLETE ANSWER CLICK THE LINK https://www.matlabsolutions.com/resources/why-can-t-i-make-a-boxplot-with-data-overlay-.php

How to create an attention layer for deep learning networks?

  Hello, Can you please let me know how to create an attention layer for deep learning classification networks? I have a simple 1D convolutional neural network and I want to create a layer that focuses on special parts of a signal as an attention mechanism. I have been working on the  wav2vec  MATLAB code recently, but the best I found is the multi-head attention manual calculation. Can we make it as a layer to be included for the  trainNetwork  function? For example, this is my current network, which is from this  example :     numFilters = 128; filterSize = 5; dropoutFactor = 0.005; numBlocks = 4; layer = sequenceInputLayer(numFeatures,Normalization="zerocenter",Name="input"); lgraph = layerGraph(layer); outputName = layer.Name; for i = 1:numBlocks dilationFactor = 2^(i-1); layers = [ convolution1dLayer(filterSize,numFilters,DilationFactor=dilationFactor,Padding="causal",Name="conv1_"+i) layerNormalizationLayer

how to define mpc object's plant as state space ?

  how to define the mpc object's plant as state space rather than transfer function. i tried to run this code but not working.     % Define system matrices (Ad, Bd, Cd, Dd) for the quadruple tank system Ad = [-0.0173190, 0, 0.026219, 0; 0, -0.0113455, 0, 0.017708; 0, 0, -0.026219, 0; 0, 0, 0, -0.017708]; Bd = [0.0395, 0; 0, 0.03598; 0, 0.076375; 0.06378, 0]; Cd = [1, 0, 0, 0; 0, 1, 0, 0]; Dd = [0, 0; 0, 0]; % Define prediction and control horizons predictionHorizon = 10; % Adjust as needed controlHorizon = 3; % Adjust as needed % Define constraints (input and state constraints) inputConstraints = [-10, 10; -10, 10]; % Adjust as needed stateConstraints = [0, 40; 0, 40; 0, 40; 0, 40]; % Adjust as needed % Define cost function weights Q = eye(4); % State weight matrix (adjust as needed) R = eye(2); % Input weight matrix (adjust as needed) % Initial state x0 = [10; 10; 10; 10]; % Adjust the initial state as needed % MPC setup mpcobj = mpc(Ad, Bd, Cd, Dd, 'Prediction

How to change the scale of color bar to discrete ?

  hi, I have my contour plot like this figure, I want to change the scale of colorbar to a discrete one with the scale value [ 0, 0.1 ,0.2 ,0.3 ,0.4 ,0.5 ,0.6 ,0.7 ,0.75 ,0.8 ,0.85, 0.9 ,1] how to do it?   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. You can use a colormap that has duplicate colors wherever the spacing between the levels is 0.1:     x = [-7.22 -6.70 -6.19 -5.67 -5.15 -4.64 -4.12 -3.60 -3.09 -2.56 -2.04 -1.53 -1.00 -0.51 0.02 0.54 1.06 1.58 2.10 2.60 3.12 3.64 4.16 4.69 5.18 5.70 6.23 6.75 7.25]; y = [7.20 6.70 6.18 5.68 5.14 4.62 4.11 3.59 3.09 2.57 2.05 1.54 1.02 0.51 -0.01 -0.53 -1.03 -1.55 -2.07 -2.59 -3.09 -3.61 -4.14 -4.65 -5.1

How to Fix "Video outside the viewport" in Google Search Console?

  Video outside the viewport   Check the Affected Pages:  In Google Search Console, navigate to the "Core Web Vitals" section or the "Enhancements" section and identify the pages that have the "Video outside the viewport" issue. Review the Placement of Videos:  Examine the pages with the issue and look for videos that are not fully visible within the user's viewport. This usually happens when the video is placed too far down the page, or the video player is too large. Adjust Video Placement and Size:  To ensure that videos are within the viewport, you can make the following adjustments: Move the video higher up on the page so that it is visible without scrolling. Reduce the size of the video player, or use responsive design techniques to ensure that it fits well on various screen sizes and resolutions. Lazy Loading:  Consider implementing lazy loading for videos. Lazy loading is a technique that delays the loading of off-screen or below-the-fold conten