Skip to main content

Posts

Showing posts from April, 2022

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

Calculating kmeans on a GPU

  Kind time of the day, dear inhabitants of the forum. I want to ask whether anyone can help me calculate the clustering of   kmeans  on a GPU it is not included in the standard function   gpuArray  but it can be calculated as a user-defined function But how to do that? I'm new to matlab and can not figure out how to implement it. NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. gpuArray  support for   kmeans  was added to MATLAB in R2016a   >> help gpuArray/kmeans kmeans K-means clustering for GPU data IDX = kmeans(X, K) [IDX, C] = kmeans(X, K) [IDX, C, SUMD] = kmeans(X, K) [IDX, C, SUMD, D] = kmeans(X, K) [ ... ] = kmeans(..., 'PARAM1',val1

How to use grpstats to sum several variables

  Hi,     I have a table of historic stock returns that I'm trying to perform some analysis on. The first variable is Stock, the second variable is Industry and 3:374 are the monthly returns.     I am looking to sum the monthly return by industry, i.e. for Materials to have the sum of the Materials stocks, which will result in a matrix/table of industries as variable 1 and the respective monthly summed returns for the other columns. NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. Given the following table, 'TStock', which is arranged as specified in your question:   TStock = 6×5 table Stock Industry R1 R2 R3 _____ ___________ __ __

Retain dummy variable labels from converting categorical to dummyvar

  Hi there,     I have 19 categorical columns which I have converted into being a number for each category. However, I want to increase the number of columns so that I have a dummy for each category. What I find is that I have no idea where the dummy variables have gone, which I need to make an interpretable solution e.g. if a user is from Thailand or not, that variable is significant in a logistic regression.     Here is my code:     %categoricalnbs is the number converted version for all the categorical %variables. Some columns in that table have categories 1-200, some just %have categories 1 to 20. categoricalnbsarray = table2array(categoricalnbs); % categoricalnbsarray = table2array(finalnbs(:,[9:26,28])); %finalnbs keeps the actual category names, which I thought could help with %generating the column labels for the dummyvars, but using that line %doesn't help. [~, ~, ugroupA] = unique(categoricalnbsarray(:,2)); dummyvars=dummyvar(ugroupA); array2table(dummyvars); This incr

How can I Count every word with three or more syllables in eachHow can I Count every word with three or more syllables in each

How can I Count every word with three or more syllables in each group of sentences, even if the same word appears more than once. Count every word with three or more syllables in each group of sentences, even if the same word appears more than once from a text file     syllables means a unit of pronunciation having one vowel sound, with or without surrounding consonants, forming the whole or a part of a word; NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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 only way you can do this is by using a database of word-syllable. Here's one way using www.dictionary.com as the database.   FullText = 'This is a really arbitrary sentence.'; %'really' could be pronoun

How do I remove a white background and only keep

  How do I remove a white background and only keep certain objects in a binary image on MATLAB? I would like the remove the white pixels in the background, but somehow keep the white lines. How would I go about doing that. Sorry I didn't mean to remove the question. I was trying to comment on my phone, but I must have unknowingly modified the question.   NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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. are you still there? Perhaps you're still struggling over this so I made a complete and fancy demo for you. Here it is:   clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all existing variables. Or clearvars if you

How I generate a random number between 300 and 450?

  Hi   I would like to generate a number between 300 and 450.   I also would like which is the possible ways to generate numbers on Matlab? Is there a Poisson generator for random numbers?   And what does the initial seed mean? NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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 create a "truncated" Poisson distribution that is based on the regular Poisson distribution, but with its range truncated to a given interval and its probability density function (PDF) adjusted so that the distribution remains a proper one (i.e., its integral over the truncation range equals 1).   For example, to generate numbers in the range [300, 450] from a truncated Poisson distribution,

How to calculate error bounds of b-spline interpolation in matlab

  Hello,     I am having a data and am trying to interpolate using b-spline toolbox in Matlab. Apart from visually identifying the accuracy, how do i measure it using equations. The code used for interpolation is given below. Please help me on this.   /**code /   p = t; q = x(:,1); plot(p,q,'co'); hold on; s_spl = Bspline(q,3);   s_rec = s_spl(1:213); plot(1:213, s_rec,'b+');   x_fine = 1:213; s_fine_rec = s_spl(x_fine); plot(x_fine, s_fine_rec,'b+');   s_fine = q; plot(x_fine, s_fine-s_fine_rec,'r'); grid on; grid minor; NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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 cannot know any kind of statistical error bounds around any interpolation me

How to run the following code for n number of rows and m number of columns.

  A=[ 1 2 3 4 5; 11 12 13 14 15; 6 7 8 9 10; 21 22 23 24 25; 26 27 28 29 30]; B=[0 0 41 0 0; 45 0 0 0 0; 0 43 0 0 0; 0 0 0 42 0; 0 0 0 0 44]; C_after_step_1=cluster_rows(A,B,[1 4]) % C_after_step_1=cluster_rows(B_part) C=cluster_rows(A,C_after_step_1,[2 3 5]) % C=cluster_rows(A,C_after_step_1) calling function function C=cluster_rows(A,B,rows) %extract the parts of the matrices A_part=A(rows,:); B_part=B(rows,:); %sum along the the vertical axis to get indices for the non-0 columns non_0=sum(B_part); %Repeat the vector back to the same size as the partial matrix. It will be %converted to a logical later on. non_0=repmat(non_0,length(rows),1); %create a copy of B, as that is the basis for C C=B;C_part=B_part; %for all non-zero columns, replace the 0 positions with the values from A C_part(non_0 & C_part==0)=A_part(non_0 & C_part==0); %paste the edited partial matrix back C(rows,:)=C_part; end   NOTE:- Matlabsolutions.com  provide latest  MatL

Generate synthetic data (or probability distribution object) from user-defined distribution function

  need to generate a synthetic dataset using a distribution that is not supported by the Matlab stats toolbox. The distribution is a Type II Pareto (or Lomax) with the probability density function   f  (   x  ) = (   a m^a ) / ( m +   x  )^( 1 +   a  ), where a is a shape parameter and m is the minimum permissible value of x. The distribution also needs to be truncated at x=50.   Is it possible to generate a probability distribution object (pd) from an equation or PDF, so that I can then use the "random" function to create the synthetic dataset? Or any other way to do this? Right now, I'm using "randsample" to do this, but that imposes a finite range or truncation on the PDF since it's an array. NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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 1

How to draw 2 random number simultaneously which are smaller than 1 together?

  I am using a formula that has 3 different parameters: alpha, beta and 1-alpha-beta. These 3 parts have to have the same average so also the same probability to be high or low.   I want to draw the alpha and beta simultaneously but together they have to be smaller than 1. It should also be possible that for instance alpha = 0.1 and beta is 0.8. I already tried to first draw alpha and afterwards draw beta with restriction 1-alpha-beta but this resulted into an alpha that is higher than beta in most cases.   I also tried to just draw 2 random numbers and make a if-loop with the restriction that both should be smaller than 1 but also this resulted into not evenly distributed results since the third part, 1-alpha-beta, was on average smaller than alpha and beta. NOTE:- Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab 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.T