Answered
I need to create a matriz since two different?
I assume you mean a 7 (rows) by 3 (columns) matrix, although I have no idea why just 3 and not 4 columns. The semicolon |;| c...

10 years ago | 1

Answered
Change the default filling of a matrix
Well, the size is obviously know at the moment you do the assignment. Either the matrix is smaller (or does not exist) before yo...

10 years ago | 0

Answered
saving data to the file
Matlab failed to open the file. There may be many reasons for this, the file does not exist / the file is not is in the current ...

10 years ago | 0

Answered
how to generate a color histogram by concatenating the higher order two bits of each color component
I'm not sure where you've seen this _standard way_. I've never heard of it. In any case, if I understood correctly: img ...

10 years ago | 0

Answered
Apply average smoothing to data from text file?
As per the documentation of <https://www.mathworks.com/help/matlab/ref/filter.html |filter|>, the coefficient |b| for a moving a...

10 years ago | 0

Answered
Pairs of elements that meet a condition?
If |fun| can only operate on scalar: cond_val = all_val(prod(arrayfun(@fun, all_val), 2) < 0, :); If |fun| can operate o...

10 years ago | 3

| accepted

Answered
How would the simpliest way to do this be?
Here's how I would construct your badly named |matrix2| (hereupon |distances|): [startAddresses, ~, row] = unique({CityToCi...

10 years ago | 0

Answered
How to calculate sum with two variables
If you're looping over |j|, then you don't use the sum function since you're accessing scalar elements: num = 0; denum = 0;...

10 years ago | 0

| accepted

Answered
How can I delete variables whose name contains a specific word?
See the <https://www.mathworks.com/help/matlab/ref/clear.htm |clear| documentation>. The option that interests you is the |-rege...

10 years ago | 1

Answered
Logical error regarding mouse input
As Adam says, there must be something wrong some logic that you haven't shown us. In any case, seeing so many |if| makes me c...

10 years ago | 0

| accepted

Answered
evaluating elements of a vector in a function file
See comments to Massimo's answer about |break|. I suspect what you meant to do is not add M? to the sum if it's negative, in ...

10 years ago | 2

| accepted

Answered
how to solve too many arguments error?
Note: it is recommended that you do not use |image| as a variable name since it's already the name of a <https://www.mathworks.c...

10 years ago | 1

| accepted

Answered
how to make an array with only single numbers from 1 till n
Another option, possibly faster: n = 19; sprintf('%d', 1:n) - '0'

10 years ago | 0

Answered
How do I import a Variable I can see in the Chrome Developer Tool (Google Chrome) into Matlab Workspace?
Out of the box, this is not possible in matlab. Matlab does not have any function to parse dynamic webpages (only static ones). ...

10 years ago | 0

| accepted

Answered
Variable names can contain upto how much number of characters in matlab last release version.?
A variable name can have as many characters as you want, however matlab only uses the first <https://www.mathworks.com/help/matl...

10 years ago | 0

Answered
A = 'hello' B = [0;0;0;0] How do I rename variable B with hello?
If you are trying to name a variable using the content of another variable, then *don't do this*. See <http://uk.mathworks.com/m...

10 years ago | 6

| accepted

Answered
Filling in a matrix (new member)
I've formatted your question into something more readable, next time do it yourself but selection all the code and clicking on t...

10 years ago | 1

Answered
separate colors of image
Have you tried using the <https://www.mathworks.com/helpimages/ref/colorthresholder-app.html Color thresholder app>? I wouldn...

10 years ago | 0

| accepted

Answered
Matlab ActiveX error after running macros
I can think of two possible reasons for the error: A) The sheet |Result| does not exist when you try to access it. As it look...

10 years ago | 0

Answered
Extracting image patches around each pixel
Since you have the imaging toolbox, a much simpler way to generate your output is by subverting <https://www.mathworks.com/help/...

10 years ago | 0

Answered
How do I represent an image and add a moire pattern?
Note that 256 is not a multiple of 3 (the width of your columns) img = repmat([zeros(256, 3), ones(256, 3)], 1, ceil(256/6)...

10 years ago | 0

Answered
How to segment data using overlapping window
Something that's really not clear is that your |ECG_data| has two rows, yet within your loop you're using linear indexing, which...

10 years ago | 1

| accepted

Answered
Why am I getting an Infinite Sum
Learn to use the <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html debugger>. Step through ...

10 years ago | 0

Answered
How to speed up a for loop ?
It looks like |A| is a 2D matrix with a variable number of rows and 3 columns. If so, does not use |length| for getting the numb...

10 years ago | 1

Answered
How to merge two bytes in matlab?
It's really not clear how you wrote the files to start with. If the digital data is a 16-bit integer, why (and how) do you write...

10 years ago | 0

Answered
How to add text from name of .txt-file into string in a cell?
Use <https://uk.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>: regexprep(yourcellarray, 'd{6}Z', sprintf('%s$0'...

10 years ago | 0

| accepted

Answered
How to find highest three peaks in histogram?
[counts, binlocation] = imhist(yourimage); %plus whatever option you used for imhist [sortedcount, indices] = sort(count);...

10 years ago | 0

Answered
Strcmp for two different Cells
Use |ismember|: var1 = {'A', 'B', 'C'} var2 = {'A', 'AA', 'B', 'BB', 'BB' , 'U' , 'V' , 'W'} ismember(var2, var1)

10 years ago | 1

| accepted

Answered
Step loop forward 10 units of a vector every iteration
As pointed out by Dr Siva, if you want a step of 10, you just write that as the step in the for loop The main issue is with y...

10 years ago | 0

Answered
Rookie needing some help with if-else and switch case.
I suggest you learn how to <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html debug your pro...

10 years ago | 0

| accepted

Load more