Skip to main content

Posts

Showing posts from June, 2023

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

why readtable create field "D" in the struct "D1"?

  function D1=TEST() D=readtable('test.txt','delimiter',','); save canc.tset D D1=load('canc.tset',"-mat") end i access it using D1.D... it's possibile to avoid "D" field?       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. If there is only one variable in the MAT file (regardless of its extension) and you do not know/care what its name is:   C = struct2cell(load(..)); assert(isscalar(C),'Only one array can be LOADed') T = C{1} If the variable name is known in advance, e.g. "D" SEE COMPLETE ANSWER CLICK THE LINK https://www.matlabsolutions.com/resources/why-readtable-create-fiel

How to remove zero from float value.?

  Hello everyone,   I have a problem I would like to help me solving it i have float value when I make division opeation and I obained value like this: 0.9093 0.9074 0.9014 I use round but I got: 0.9000 0.900 0.900 0.900 Iwant to remove these zeros to be 0.9 0.9 0.9 0.9   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. x = [0.9093 0.9074 0.9014] x = 1×3 0.9093 0.9074 0.9014 vpa(round(x,1),2) ans = (0.9 0.9 0.9)   SEE COMPLETE ANSWER CLICK THE LINK https://www.matlabsolutions.com/resources/how-to-remove-zero-from-float-value-.php

how use uigetfile to get file or new file?

  i give you an example to do it   i want to select a nome list (provaaa.ttslist2) o digit new file (pippo).. I try it (pippo) with uigetfile but it give me error   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. Well, there is no file of that name in the displayed directory;  uigetfile  does not return a file that does not already exist; that's just the nature of the beast.   To either select an existing file  OR  allow the user to create a new file, use  uiputfile  instead; it has the same appearance but will return the new user-supplied file name if given rather than a selected name.   The other difference is that if the user does select an exist

This app was created in a newer version of App Designer and cannot be opened for editing

  Hi there,   I'm currently working with MATLAB 2017b and using App Designer to develop a simple app. The problem raised when I asked my friend to complete a part of the code on his PC. Everything were working well there but when I tried to open the completed code (.mlapp file) in my version I got the following error:   "This app was created in a newer version of App Designer and cannot be opened for editing"   Any idea except updating the whole MATLAB to 2018 version, will be greatly helpful!   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. There was a change made between 17b and 18a to the way App Designer saves an app. Your friend on t

How do I get smooth edges for a contourf plot on a log-log scale scatterplot?

  Hello,   I am having some trouble with using the contourf function on a log-log scale plot. I have 9 datapoints in a 2D scatterplot that are colored for a third variable. The code I use to plot the data as well as the plot are included below.   a = reshape(mtot_1,1,[]); % convert matrix to row vector b = reshape(MFR_1,1,[]); % convert matrix to row vector c = reshape(SN_maxes_1,1,[]); % convert matrix to row vector figure(4) clf hold on scatter(b, a, [], c, 'filled') set(gca,'xscale','log') set(gca,'yscale','log') colorbar xlabel('MFR') ylabel('total mass flow') As you can see, on a log-log scale, the datapoits form a sort of "skewed quadrilateral" shape with edges that look "straight" when plotted on log-log. I want to create a contour map from these 9 points, but when I do, it looks like the plot below because the contour is generated with a linear interpolation method that creates straight lines between t

one of the colorbars is going out of the figure window

  I am trying to bring two pcolor plots on top of each other with different colormaps. One of the colorbars goes out of the figure window, have tried placing the colorbar in other places like southoutside or westoutside and the same problem persists. Is there any better way to do it? Any help is appreciated.   f = figure; ax = gca; ax(2) = copyobj(ax, ax.Parent); linkprop([ax(1), ax(2)], {'XLim', 'YLim','Position', 'View'}); p = pcolor(ax(1), xc, yc, e); set(p, 'EdgeColor', 'none', 'FaceAlpha', 1); set(ax(1), 'Colormap', bone); cb(1) = colorbar(ax(1), 'eastoutside'); p2 = pcolor(ax(2), xc, yc, d); set(p2, 'EdgeColor', 'none', 'FaceAlpha', 0.5); set(ax(2), 'Colormap', copper); cb(2) = colorbar(ax(2), 'northoutside'); ax(2).Visible = 'off'; ax(1).XAxis.FontSize = 14; ax(1).YAxis.FontSize = 14; ax(2).XAxis.FontSize = 14; ax(2).YAxis.FontSize = 14; ax(1).FontSize = 14; ax

How we can use fminsearch with a vector as input and return a scaler as an output?

  Hello, I have the objective function and I want to minmize this gradiant. e is a vector of ones and y is a vector of size . The . I want find that minmize this objective function. Here is my attempt: y = rand(1000, 1); % Random target values e = ones(size(y)) global y My target function is : function gradient = gradient(h) global y gradient = 2 * (h*ones(size(y)) - y); end and then calling the function into fminsearch to get the result by : mu_y = fminsearch( @(h)gradient(h),0); and I got the error massage : >> mu_y = fminsearch( @(h)gradient(h),0); Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1000-by-1. Error in fminsearch (line 201) fv(:,1) = funfcn(x,varargin{:}) Can someone please help in this problem thanks.   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help,MatLab Assignment Help  ,  Finance Assignment Help  for students, engineers and researchers in Multiple Branches like ECE,

How to make a surface in polar coordinates using polar3d?

  Hello! I have an integral for a function which I plot in polar coordinates at a fixed polar angle theta (th). How to write a 3D plot for R in polar coordinates (angles a and th changes)? I made it using pol2cart, but this is not the best way to present the result. If somebody can help me to plot using polar3D or something like this, it would be great. Thank you.   clear all   s = 3; n = 1; r = 1; t = 0.1; th = 0:10:360; % angle theta a = 0:1:360; % angle alpha b = sqrt(2*n*t); L = sqrt((4*t+r^2)/3);   fun = @(k,u,c,a) ((k.^2).*exp(-1.5*k.^2)).*((u.^2).*(1-u.^2).*exp(-(b.*u).^2).*(cos(s.*k.*u.*cos(a)/L))).*(((cos(c)).^2).*(cos(k.*sqrt(1-u.^2).*(s.*sin(a).*cos(th).*cos(c)+s.*sin(a).*sin(th).*sin(c))/(L)))); f3 = arrayfun(@(a)integral3(@(k,u,c)fun(k,u,c,a),0,Inf,-1,1,0,2*pi),a); B = ((6*sqrt(6)*(b^3))/(erf(b)*(pi^2)))*(1-(3/(2*b^2))*(1-((2*b*exp(-b^2))/(erf(b)*sqrt(pi)))))^(-1); R = B*f3;   figure(3) polar(a,R); This is how it look in Cartesian coordinates (theta in radians), but it sho

How can I take the rgb value of an image and color correct to an original rgb value?

  I am needing to write a code that takes the rgb value of a reference square in an image, and color correct it to the orginal rgb value of the reference square.   I will have various images with this reference square that will change colors depending on how the sunlight hits it, so I need to correct the whole image back to the original color. Is there a code that can be written to do this? Additionally, I mainly am focused on the blue values, but how will the change in values be stored?   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 forgot to attach your reference image and the image that needs correction.   Basically you need to segment the ima

How can I find the elapsed time between two images from video file with matlab?

  How can I find the elapsed time between two images from video file with matlab?   I drop a drop of water on a surface. I want to find the water absorption time of the surface from the video I recorded with MATLAB. Can you help me? I don't know much about Matlab.   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. To find the elapsed time between two images from a video file in MATLAB, you will need to follow these steps: Read in the video file using the VideoReader function.   video = VideoReader('your_video_file.mp4'); 2. Extract two frames from the video. frame1 = read(video, frame_number_1); frame2 = read(video, frame_number_2); 3. Conver