I'm new to matlab. I have the a file named iris.data and I'm trying to load it's contents into variables. The file have the folowing contents: 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa 4.7,3.2,1.3,0.2,Iris-setosa 4.6,3.1,1.5,0.2,Iris-se
I have data in a text file, which contains varying amount of columns at each row in the text file. The data I have is at following format: 2 21 2623 707 40 1 After there's three numbers in a row the data remains at the same structure until the end of
I would like to run a simulation using Simulink, and I would like to use data from a txt file. I have try using x_ref_n0 = importdata('x_n_ref0.txt'); However, I am getting an error message: The function 'importdata' is not supported for standalone c
This question already has an answer here: Weighted random numbers in MATLAB 4 answers I have to generate a random variable that ranges from 20 to 30, with 0.1 interval, and the pmf of it is given by 1x101 matrix (for x=20, 20.1, ... 29.9, 30). Now I
I'm trying to convert a straight-forward C code to matlab but I got stuck in something that seemed to be quite clear at first. What's this segment doing? SIZE_N2 = 25, w = 533, h = 800 //Init the L matrix. L is a sparse matrix that only contains SIZE
I am trying to rotate a square image in Matlab in various angles without cropping the central object and having black regions to increase my dataset for object recognition purposes. Here is the original image: With my current attempt, function imF =
I used ADAPT for incremental training a simple network, and i know that ADAPT changes weights and biases,i used this: clc clear all net = linearlayer([0 1 2]); pi = {[1; 1] [2;2]}; p = {[3 ;4] [5; 6] [7;8]}; t={[40; 50; 60] [10 ;20; 30] [70;60;50]};
my initial code for histogram equalization computes freq(1) to freq(254) perfectly and computes freq(255) and freq(256) wrongly. Wrongly as in the result at freq(255) is the summation of the actual result at freq(255) and freq(256). And freq(256) alw
I have a code that generates all of the possible combinations of 4 integers between 0 and 36. This will be 37^4 numbers = 1874161. My code is written in MATLAB: i=0; for a = 0:36 for b= 0:36 for c = 0:36 for d = 0:36 i=i+1; combination(i,:) = [a,b,c,
I have a question about matlab programming about sine curve. The question is as below: Consider the definition: function [s1, s2, sums] = sines(pts,amp,f1,f2). The input, pts, is an integer, but amp, f1, and f2 and are not necessarily integers. Outpu
From the MATLAB R2015a documentation, the functions pcolor, image and imagesc are expected to produce nearly the same output, being the only "practical" difference that pcolor outputs surfaces viewed from above while image and imagesc uses the c
I want to calculate a function p of x,y: p(x,y) which is defined by the integral of another function of x and y: p(x,y) = Integral(indefinite) of v(x,y) dx Now, if I have a matrix expressing p on a uniform grid x and y, how do I construct the functio
I'm using fminsearch to find the optimal solution of a problem and for some reason that is not related to the issue, I'm doing it by parts, calling fminsearch repeatedly. So, I have access to the value of the function (fval) everytime I call it (the
I have two cell arrays. One is 'trans_blk' of size <232324x1> consists of cells of size <8x8> and another 'ca' is of size <1024x1> consists of cells of size <8x8>. I want to compute mean square error (MSE) for each cell of 'ca' wit
Looking for a command similar to repmat but for tiling tables instead of arrays. My thinking is there might be a quicker/cleaner way than using a for loop. Cheers
I've got a fairly large and complex text file to read into MATLAB. The basic format looks something like this: 000723 4 123.12345 5 234.76543 ... 178.94444\n The first column is always a six-digit date in yymmdd format, and the last column is always
My task scheduler opens MATLAB, but doesnt run 'file.m'. It just stands there with the cursor flashing in the command window! This is more than frustrating. Please help me, please. I have added the path to the file so it is not to do with pointing to
I'm totally new to MATLAB, and I have dificulties with some code I have to understand for my project. Here is the code : feature = feature(1:64,:,:); feature(43,:,:) = []; feature(33,:,:) = []; feature = feature([36,38,45,46,47,53,54,55,59,60,61],:,:
Hi everybody I have this problem: I have Dataset of n vectors each has D dimensions. I also have a covariance matrix of size D*D, Let It be C. I perform the following action: I choose K vectors from the dataset, and also choose E dimensions randomly.
I have the following code but it is not giving me the values I want. The loop is not working. Basically, I want the variables J1, J2, J3, J4 and J5 calculated from each coordinates of Mx and My which is used to calculate P in an existing Simscape fil