I have a string: pairs = ['AA';'AB';'BB';'AC'; 'CC'; 'CB';'DE'; 'BC'] How can I delete the element which has the same characters in its string like 'AA','BB', 'CC' ? The expected output should be: out = ['AB';'AC';'CB';'DE';'BC'] --------------Soluti
i have a question regarding histc: I choose the max and min of a sorted signal as my range. ma = ssigPE(end); mi = ssigPE(1); range = mi:ma; [bincountsO,indO2] = histc(ssigPE, range); so the range i get back is: range = [-1.097184703736132 -0.0971847
I want to represent time in time-series object in matlab in following format. dd-mmm-yyyy HH:MM:SS.FFF. I have converted my date into desired date string format but when I create time-series object then fraction value of the second is rounded off to
This question already has an answer here: Getting the last element of a list in Python 5 answers When I work in Matlab, I use the refer to the last element of a vector with 'end'. For example: A(1, end) where A is a 2x2 matrix. Can you tell me what i
There seems to be no built-in logging infrastructure in Matlab. Googling over expernal packages solving this problem give two results: Log4m, which aims to imitate Log4j feel. (2012) Log4matlab, which has a slightly more recent version. (2013) Which
I'm using MATLAB R2012b on a win7 computer. When I launch MATLAB from cmd using matlab -nodesktop, the tab is disabled for auto-completion in command line window. So I have to type the full name of a file, a path or a function. When I open GUI and se
A little background I'm working on a project that requires me to use an old (from 2006) large system of MatLab scripts. The script exists in an archive folder on a cluster but I need it to run fully from my cluster folder. I've got it mostly running
I have a TLC generated mexfunction with 2 inputs and 0 output. input 1 is unsigned char and input 2 is unsigned int. When I try to get input values with: unsigned char *u1 = ssGetInputPortSignal(S,0); (uint8) unsigned int *u2 = ssGetInputPortSignal(S
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