Answered
I want to add column 1st from data1 and coloumn 1st from data2, likewise addition of all coloumn.
MATLAB makes these things really easy: >> A = [ 4 8 6 3 5 7 1 9 2]; >> B...

11 years ago | 1

| accepted

Answered
Problem with sprintf and evalin
_"What have I done wrong?"_ You decided to use |evalin|. Poor choice of programming tools makes your code buggy, as you ar...

11 years ago | 1

Question


Calling a nested function from a dynamic regular expression throws an error
Calling a <http://www.mathworks.com/help/matlab/matlab_prog/local-functions.html local function> from a <http://www.mathworks.co...

11 years ago | 2 answers | 1

2

answers

Answered
Search and replace a word of text file from GUI
A text file _is_ a string. So just read the file using <http://www.mathworks.com/help/matlab/ref/fileread.html |fileread|>, and ...

11 years ago | 1

| accepted

Answered
Error using .* Integers can only be combined with integers of the same class, or scalar doubles.
Assuming that |imn| and |image| are both of the same integer class, then use the third input argument of <http://www.mathworks.c...

11 years ago | 0

| accepted

Answered
Error Using * and ^
Try using <http://www.mathworks.com/help/fixedpoint/ref/times.html |times .*|> instead of <http://www.mathworks.com/help/fixedpo...

11 years ago | 0

Answered
How to make plot visible?
*Problem* You did not read the <http://www.mathworks.com/help/matlab/ref/linspace.html |linspace|> documentation before using it...

11 years ago | 1

Answered
How I can plot this bar graph
If the values were integer then it would be possible using |unique|, but because you have floating-point values I would recommen...

11 years ago | 1

Answered
executing of function don't works
You are trying to use a function that does not exist. Like this: >> this_does_not_exist(5,7) Undefined function 'this_do...

11 years ago | 0

Answered
Drawing rectangles using matrices.
You can use MATLAB's array indexing quite effectively for this: >> X = ones(256,256,3); >> X(40:140,[40,140],:) = 0; ...

11 years ago | 1

Answered
How can I set different colors for lines from nested loop?
This is the figure that your code generates: <</matlabcentral/answers/uploaded_files/46340/untitled2.png>> _"All of the li...

11 years ago | 0

| accepted

Answered
¿How can I get the value of a variable that is inside a function?
Those warning messages are extremely simple to get rid of, either individually (per line), per file, or as a MATLAB setting. It ...

11 years ago | 0

Answered
How can I get a fractional iteration value?
You can iterate over fractional values: for k = 1./(2:5) disp(k) end However if you are using the |k| values a...

11 years ago | 0

Answered
How to keep a for loop going after error
doc try Simply put in a <http://www.mathworks.com/help/matlab/ref/try.html |try|>: for k = 1:N try ... ...

11 years ago | 1

| accepted

Answered
How to get the matrix with maximum(or minimum) number of elements
It is much easier to perform these kind of operations when all of the data are in one variable. So that is the first thing to do...

11 years ago | 1

Answered
Connecting points in graph
It is not creating the lines correctly because you are using <http://www.mathworks.com/help/matlab/ref/line.html |line|> incorre...

11 years ago | 0

Answered
what it mean s(1) and s(2)
Judging by the context |s| is most likely just *one* variable, and the code simply accesses the first and second elements of the...

11 years ago | 0

| accepted

Answered
Error: Output argument "__" (and maybe others) not assigned during call to "__"
The problem is simple. In your function you define |bill| for each of these cases: function bill = longTerm(mins) if min...

11 years ago | 0

Answered
How can I say if (A & B) or C in Matlab?
You need to consider the *size* of your operands. You have not told us their sizes, but this is very important information for u...

11 years ago | 0

Answered
Unique elements in matrix efficiently
Without any loops (and can be easily adapted to use a tolerance): A = [1 2 3 1; 4 1 6 7; 8 9 8 11] S = size(A); [B,C]...

11 years ago | 0

Answered
How to implement Look Up Table function with cells
This is easy via a <http://www.mathworks.com/help/matlab/ref/containers.map-class.html |containers.Map|> object: >> a = {'E...

11 years ago | 1

| accepted

Answered
How to access data from "Structure within structures" ?
If every field has the same size, then this will work: M = vertcat(Sdata.BoundingBox); M(:,3:4) And here is a simple ...

11 years ago | 1

| accepted

Answered
I need to partition an input vector v into smaller series of subvectors each containing the whole array of a periodic pattern given by a local sum of successive elements in the array.
v = [14,97,38,41,22,6,27,55,55,22,33,22,6,27,22,33,55,1,35,19,22,33,22,33,22,33,22,33,22,33,55,12,18,23,67,92,12]; N = 55; ...

11 years ago | 1

| accepted

Answered
How do you set a uniform bin count for histograms?
Easy. Sort your data. That's it. If you really want to split them up then use |reahape| (or |mat2cell|). The bin edges can be fo...

11 years ago | 0

Answered
Finding the equal elements in 2 matrices
You need to take into account that MATLAB operates _column-wise_ by transposing your matrices: >> a = [90,50;20,11;0,87;11,...

11 years ago | 0

| accepted

Answered
How do I expand fields of a structure?
Here are some possibilities: * display the numeric matrix in the command window, and copy it from there. * write your data t...

11 years ago | 0

| accepted

Answered
Hello, i have two diffrent sizes arrays and i want to subtract the first element with the first sixty element to the other array and then the secont element with the next sixty elements. How can i do this?
Taking a wild guess in the dark, perhaps you want something like this?: >> A = (1:16).'; >> B = (1:1000).'; >> C = [A...

11 years ago | 1

| accepted

Answered
how to represent a base number
Do you want this:? >> x = 3; >> x*(1i-2) ans = -6 + 3i

11 years ago | 0

Answered
how to create a customized array and running a counter through it?
Store your arrays in a <http://www.mathworks.com/help/matlab/cell-arrays.html cell array>. Loop over the cell array: A = ce...

11 years ago | 0

| accepted

Answered
match row and column
You can use <http://www.mathworks.com/help/matlab/ref/ismember.html |ismember|> to generate the logical indices. In the same ord...

11 years ago | 0

| accepted

Load more