Answered
I want TEXTSCAN to be able to consider spaces in front of numbers
Yes, as Star says you probably have to go at a lower level than text scan. In this case, this is what I would do: wholefile...

10 years ago | 0

Answered
Random Draw of Vectors
Not too clear on what the inputs are, I am assumed that these 27,748 252x2 subsets are stored in a cell array: subsets = sq...

10 years ago | 0

| accepted

Answered
How to find duplicate rows in a matrix ?
Well if you want to remove duplicate rows, the simplest is: matrixwithnoduplicaterows = unique(matrixwithduplicaterows, 'ro...

10 years ago | 1

Answered
Changing strings in a cell array to matrix form
Well, the more important question is why are you in a situation which requires you to do that as this tends to indicate that the...

10 years ago | 0

Answered
How can I solve the " Index exceeds matrix dimensions" error for the following code ?
_"How can I solve the " Index exceeds matrix dimensions" "_ Easy, don't index past the matrix dimensions! Since we have no...

10 years ago | 0

Answered
why I must enclose array bracket '[]' to show the image on next process after apply multithresh?
The |[]| is used to override the default <http://www.mathworks.com/help/matlab/ref/imshow.html#inputarg_DisplayRange |'DisplayRa...

10 years ago | 0

| accepted

Answered
load C++ shared library into Matlab, files not found
As per the <https://www.mathworks.com/help/matlab/ref/loadlibrary.html documentation of |loadlibrary|>: _" |loadlibrary(libna...

10 years ago | 0

Answered
How to delete a posted thread
Only users who have earned <http://www.mathworks.com/matlabcentral/answers/help?s_tid=gn_mlc_ans_hlp#privilege enough reputation...

10 years ago | 0

Answered
removing rows contain NaN element from 3D array
No, you cannot have different size pages in a matrix. You could convert the 3D array into a cell array of 2D matrices and re...

10 years ago | 1

| accepted

Answered
Check directory is full or not?
First, note that there isn't really a concept of a full directory. Directories themselves don't have a space limit (unless it's ...

10 years ago | 0

| accepted

Answered
error subscript indices integers or logicals
Without knowing the content of the variables, it's difficult for us to diagnose the problem. However, the line: l = numel((...

10 years ago | 0

Answered
Accessing the deeper components of a cell array
You don't have a choice but use a loop or |cellfun| (which is a loop in effect): cellfun(@(v) v(3), yourcellarray) will ...

10 years ago | 1

| accepted

Answered
How do I assign a full word to a single array position?
You can't. For matlab, each character is the same as single number and as you know you can only have one number per matrix eleme...

10 years ago | 0

| accepted

Answered
Can you "merge" adjacent cells in a matrix?
Matlab is not excel, this is not possible.

10 years ago | 0

Answered
How to predict the values of zeros in an mxn matrix
If I understood what you want correctly then you can't use |interp2| as it required known values for each intersection of a grid...

10 years ago | 0

| accepted

Answered
Find entire rows in a matrix where a column value meets a certain condition
filteredmatrix = originalmatrix(round(originalmatrix(:, 4), 4, 'significant') == 101300, :); is all that is needed.

10 years ago | 1

| accepted

Answered
How to assign mutliple vectors to matrix diagonals
I have no idea what you're trying to do with your code, it makes no sense, from the comment about creating a sparse matrix follo...

10 years ago | 1

Answered
How can I arrange my output from regexp stored in multiple cells in a for loop?
As per comment to question, changing the regex to take into account the optional letter is not a problem. To produce your out...

10 years ago | 1

| accepted

Answered
How to use arrayfun with a function having two vector arguments?
%W = [.,.,.;.,.,.;.,.,.]; %matrix %x = [.,.,.,.,.,.]; %vector result = arrayfun(@(xelem) f(W, xelem), x); %possibly wi...

10 years ago | 0

Answered
Why does function create 'ans' output when it is already assigned?
There are actually two cases where you'll get a |ans =| display. The first one is simply caused by the way you call your func...

10 years ago | 1

| accepted

Answered
Image thresholding for different regions of the image
Using some sort of adaptive contrast adjustment (such as <https://www.mathworks.com/help/images/ref/adapthisteq.html |adapthiste...

10 years ago | 0

| accepted

Answered
Matlab language to C
If |n| is smaller than 1, the loop will not execute, hence |er| will never get created. Either assign a default value to |er| be...

10 years ago | 0

| accepted

Answered
How can I find MIN value with same number in the other column?
Here is one way of doing it: A=[1,1; 1,2; 1,3; 2,4; 2,5; 2,6; 3,7; 3,8; 3,9...

10 years ago | 0

| accepted

Answered
How to find occurence of elements of a vector in another vector?
cellfun(@(interval) sum(ismember(a, interval)), b) For each interval, |sum(ismember(a, interval))| is the number of times e...

10 years ago | 0

Answered
Modify your Turtle class to allow the user to change the pen color and pen width.
D- for effort. As your assignment says: _"You will need to add two methods to the Turtle class: *|obj = penColor(obj,new_colo...

10 years ago | 2

Answered
concatenate all value in a matrix into one number
v = [1 2 3 4]; assert(all(v >= 0 & v < 10 & mod(v, 1) == 0), 'elements of v are not single digits'); sum(10.^(numel(v)-1...

10 years ago | 0

Answered
How to cut a vector in intervals?
Use <http://www.mathworks.com/help/matlab/ref/mat2cell.html |mat2cell|>: v = 2:97; intervallength = 3; assert(isrow...

10 years ago | 1

| accepted

Answered
f(x)=3x^3-5x^2+3x-7=0
I can tell you the result without even trying to run your code. it's going to error with _Unexpected MATLAB expression_ on |fx =...

10 years ago | 0

Answered
impixel fails when a function is called the second time.
The problem is not with |impixel| but with your code. For |impixel| with three inputs, the first input is an *image*, the next t...

10 years ago | 0

| accepted

Answered
I tried this code but it doesn't work. Anyone can ans.it?Please.
This seems to be two completely different problems in the same question. I don't see how the first part (creating |datatarget|) ...

10 years ago | 0

Load more