Answered
Searching Between Vectors to Create a Percent of Equality
This looks related to your previous question (was this ever resolved)? I've not tried to understand your code, but the result...

11 years ago | 0

Answered
Check if cell contains specific letter
Many ways to do this: c = {'hi'; 'my'; 'name'; 'is'} lettertofind = 'i'; %method 1: plain character comparison ...

11 years ago | 1

Answered
How to compute the hash of a string using SHA algorithms
There are no functions in matlab to calculate hashes. However, you can call Java (any OS) or .Net (Windows only) functions direc...

11 years ago | 9

Answered
create number of arrays dynamicly
_"but i want these arrays to be visible in my workspace"_ Why would you want that? If they are different variables, you can't...

11 years ago | 1

Answered
Four element Array from workspace and plot it
plot(a(1:2:end), a(2:2:end)) is one way to do it. But what you should do really is reshape |a| in x and and y rows: ...

11 years ago | 0

| accepted

Answered
How to check a pixel is within a range?
If I understood correctly, this is the algorithm: DM = dlmread('Dm.txt'); for level = 0 : 12 Aux = ~ismember(DM, m...

11 years ago | 0

| accepted

Answered
How to create OOP properties with subfileds
As Adam says, once you've gone OOP you may as well go OOP all the way and have |Task| an instance of another class. Otherwise, y...

11 years ago | 0

Answered
Hi, I am trying to vectorize following for loop. Need some help??
This is a case where the _'old'_ histogram functions work better than the newer one. If you pass a matrix to <http://www.mathwor...

11 years ago | 0

| accepted

Answered
using regexp for space delimited strings in text file.
Well, I guess it's time for you to learn the <http://www.mathworks.com/help/releases/R2015b/matlab/matlab_prog/regular-expressio...

11 years ago | 0

Answered
How to change value for linear increasing column-structure
There are many ways of achieving this. Here is one: m = zeros(594, 1183) + 10; m(logical([zeros(53, 1183); zeros(...

11 years ago | 0

| accepted

Answered
Create a table/matrix of strings
Here is one way to do it: c = {'(43)2' '(43)42(34)' '042123'}; substrings = regexp(c, '(?:\(\d+\))|\d', ...

11 years ago | 0

| accepted

Answered
Loop Failed for Extracting Matrix from Cell Arrays
If you'd used the debugger to see what was happening with your loops, you would have quickly realised that you have one loop too...

11 years ago | 1

| accepted

Answered
Scan exactly 1 pixel around a location and determine max value
There are many ways you could do this (e.g using loops). Here is a possible solution using |bsxfun|: imagewidth = 100; %f...

11 years ago | 0

Answered
In a table with duplicate ids, how do I merge rows with values with rows with NaNs?
As per Walter's answer, you can use |min| (or |max|) to get the non-nan value in each row. There is a very handy function, <http...

11 years ago | 0

Answered
Evaluate geographically distributed data over a polygon
I'm not entirely clear on how you define your polygons, I don't understand why you'd want to use |poly2mask|, but if they are de...

11 years ago | 0

| accepted

Answered
How do I add sequential groups of numbers using a "for end" loop
_"So my entire problem is this; I have a year's worth of data for a job I have to do. This data is in 15 minute increments. I ne...

11 years ago | 0

Answered
Creation of timeline with multiple occurrences of various events?
This is a variation on that timeline code that copes with duplicate events: function timeline2(list) %make sure the li...

11 years ago | 0

| accepted

Answered
Matlab Error Message?
Your |x| must have strictly more or less than 100 rows. Hence the assignment fails. Note that a much simpler way of achieving...

11 years ago | 1

| accepted

Answered
Hex mask on all table column elements
matlab does not use the |&|, |||, etc. operators for bit-wise operations, and these do not apply to string anyway. Bit-wise ope...

11 years ago | 0

Answered
How to find 3 maximum element in array and their indices without sorting
You can call |max| three times, each time removing the element you found, but see my comment above, you are effectively sorting ...

11 years ago | 0

| accepted

Answered
multiply correspond element in cell arrays
Use |cellfun|: c = cellfun(@times, a, b, 'UniformOutput', false) %times is function name of .* This will only work if all...

11 years ago | 1

| accepted

Answered
How can I make all the variables in an array 0 after the first time 0 occurs in the array
A very simple solution that only works with an array of 0 and 1 starting with 1: x = [1,1,1,1,1,0,0,1,1,0,0,0] cumprod(x...

11 years ago | 1

Answered
In an assignment A(:) = B, the number of elements in A and B must be the same
There are two issues with your code, one which may not cause you problem right now: Problem 1: The use of |length| with a 2D ...

11 years ago | 0

| accepted

Answered
Write out a cell whith characters and numbers to excel
|xlswrite| only works with cell arrays that contain scalar numeric or string vectors. My guess is that you want end up with 23 r...

11 years ago | 1

| accepted

Answered
To accept two numbers from the user and display perfect numbers between these two numbers. Can anyone help to convert this codes to somethings simpler to understand?? It's too complicated for me as i'm still new to matlab...
Other than the extremely poor naming of variables and the lack of check that the user entered positive integer in the right ord...

11 years ago | 1

Answered
How to swap matrix ?? Anyone can help me to improve my code.?? I want 12No of 30's & 8 Nos of 0's in every iteration.
If you're asking for a better implementation of your *commented out* code above: M = [30 30 30 30 30 30 0 0 0 0 0 0 0 0 30 ...

11 years ago | 0

Answered
how to find cell array elements in other arrays
The <http://www.mathworks.com/help/matlab/ref/ismember.html |ismember|> function is your friend. To make it easier to perform th...

11 years ago | 0

Solved


number of occurrences of letter in a text
Given an input text either as a string or as a cell array of strings, return a (1 x 26) matrix containing the number of occurenc...

11 years ago

Answered
Subscript indices must either be real positive integers or logicals in bsxfun
As Star said, one of your problem is the use of |T| to index into itself. That makes no sense, I'm not sure what you intended wi...

11 years ago | 0

| accepted

Answered
Separate a vector into pairs of segments
If you are asking how to create numbered variables |p1|, |p2|, |p3|, etc. then the answer is an emphatic: *don't do that*! It on...

11 years ago | 0

Load more