Answered
Average values for duplicates in (:,1)
You can use <http://www.mathworks.com/help/matlab/ref/unique.html |unique|> and <http://www.mathworks.com/help/matlab/ref/accuma...

11 years ago | 0

Answered
Picking out stage coordinates using sscanf
>> A = sscanf('-1042,7953**Tile1','%f,%f**%s'); >> X = A(1) X = -1042 >> Y = A(2) Y = 7953 >> C = char(A(3:end...

11 years ago | 0

| accepted

Answered
Error: Matrix dimensions must agree
It depends on what you are trying to do. First you should learn about <http://www.mathworks.com/help/matlab/matlab_prog/array...

11 years ago | 0

Answered
Elements into a String
C = {'ham', 'cheese', 'bread'}; D = {'milk', 'apples', 'cherries'}; X(2,:) = C; Y(2,:) = D; X(1,:) = {', '}; ...

11 years ago | 1

Answered
More than 1 elseif statement with 3 different numbers
You should have been a bit more patient answering and accepting your own question, because your "answer" is totally wrong. The c...

11 years ago | 1

Answered
Passing functions to functions
Your basic problem is that you are not calling |f| inside the |while|-loop: you call |f| twice _before_ the loop, but never _ins...

11 years ago | 0

Answered
Summing specific values in arrays
This is exactly what <http://www.mathworks.com/help/matlab/ref/accumarray.html |accumarray|> is for: >> X = [2,3;4,5;2,5;1,...

11 years ago | 0

Answered
How can save to a matrix to txt file
The problem is not the _file_ or the _code_, the problem is the _text editor_ that you are using. Microsoft Notepad is very poor...

11 years ago | 0

Answered
How to Save a raw array and delete NaN in a raw array
In MATLAB there is *no such thing* as an *empty cell*. Every cell contains something, even if it just an empty array. Initializi...

11 years ago | 0

Answered
What is heaviside and how replace ?
When you do a search of the documentation like this: <http://www.mathworks.com/help/search.html?qdoc=heaviside> the *green...

11 years ago | 0

| accepted

Answered
How to store cell array values from a for loop into another array/matrix?
You don't need to use a loop, just use indexing: newmat = C{1}(3:8:end); Of course you can adjust the |end| term to limi...

11 years ago | 1

| accepted

Answered
Reusing deleted figure handle
How about simply keeping _all_ of the axes (no deleting!) and switching the axes' <http://www.mathworks.com/help/matlab/ref/axes...

11 years ago | 0

| accepted

Answered
Replacing elements of a text file
This is easy to do using some simple commands: >> str = fileread('mappa.txt'); >> idx = str~='i' & isstrprop(str,'alpha'...

11 years ago | 0

| accepted

Answered
Get the Array Number, when value changes
Given your uploaded data (attached below), this code will identify the locations where the value changes: tol = 0.01; da...

11 years ago | 0

Answered
Check edit text box validity for "i" and "j" characters
Rather than converting to numeric, simply check that the string contains only digits. This is easy using the inbuilt function <h...

11 years ago | 0

Answered
How to choose a specific area of an image?
You need to use some kind of <http://www.mathworks.com/help/matlab/math/matrix-indexing.html array indexing>. Often the easiest ...

11 years ago | 0

| accepted

Answered
Needed help with figures
You could use the <http://www.mathworks.com/help/matlab/ref/datetick.html |datetick|> command, which has many date format option...

11 years ago | 0

| accepted

Answered
how we find a particular number from the matrix in matlab????
It is not clear what numbers you want: when you write that you want _"this number"_, are you referring to the _indices_ of the f...

11 years ago | 0

| accepted

Answered
Bad practice to be concentrating size less than or equal to size 0 vectors???
The second shorter method is much better, and is the more MATLAB-y solution. There is no problem with calling <http://www.mat...

11 years ago | 0

Answered
how to convert output to integer?
The output values are hexadecimal because that is exactly what you are telling <http://www.mathworks.com/help/matlab/ref/fprintf...

11 years ago | 0

Answered
Not enough input arguments? Why does this not work?
You don't need to write a function, just use the inbuilt <http://www.mathworks.com/help/matlab/ref/cast.html |cast|> function: ...

11 years ago | 0

Answered
The code below explains program to evaluate a 2x2 rotation matrix for given input angle.The code seems to be fine for all elements but one in1st row and second column.Can't figure out where I'm wrong.
Using loops is very inefficient code. Try this instead: function mat = rotmat2d(theta) assert(isnumeric(theta)&&isscalar...

11 years ago | 0

| accepted

Answered
how can I convert a .png file to .svg file?
<https://en.wikipedia.org/wiki/Portable_Network_Graphics PNG is a raster graphics file format>, while <https://en.wikipedia.org/...

11 years ago | 0

Answered
I'm writing a function which takes a 3x3 matrix as input and gives an angle and a position vector as output.Position vector has 3 more output arguements. Please help me identify the mistake i have made.
In MATLAB do not define the output variable _types_ (or classes) explicitly, and one cannot use the character |';'| within the f...

11 years ago | 2

| accepted

Answered
hi i have 1x10 cell,each cell contains 1x2 cell,therefore totally i have 20 cells,i need all these 20 cells to be displayed in single array as 1x20 double ,how to code this in matlab sir,help plz
You do not need a loop: X = {[1,2],[3,4],[4,5]} [X{:}] And if those nested arrays really are cell arrays, then simply...

11 years ago | 0

| accepted

Answered
When using inputdlg with str2double, Matlab hangs if a number is entered without a nonzero decimal
This |waitfor| call does not make any sense. The <http://www.mathworks.com/help/matlab/ref/inputdlg.html |inputdlg|> documentati...

11 years ago | 2

| accepted

Answered
Load a txt file:
You could use the function <http://www.mathworks.com/help/matlab/ref/textscan.html |textscan|>, which lets you select the header...

11 years ago | 0

| accepted

Answered
Loop through a matrix with multiple elements with the same values
The basic steps will be to: # find how many values there are. # repeat that code for each variable. It seems that you are...

11 years ago | 0

Answered
Combine the rows of an mxn cell array into a single mx1 cell array.
num2cell(A,2)

11 years ago | 0

| accepted

Load more