Problem


Count letters occurence in text, specific to words with a given length.
Build a function with two input arguments: a string and a word length (number of letters), that outputs a vector of counts of th...

13 years ago | 4 | 197 solvers

Solved


Count letters occurence in text, specific to words with a given length.
Build a function with two input arguments: a string and a word length (number of letters), that outputs a vector of counts of th...

13 years ago

Answered
Managing Matrix Content Using Loop ?
>> A = magic(3) % Just an example.. A = 8 1 6 3 5 7 4 9 2 >> v = A(:)...

13 years ago | 0

| accepted

Answered
Can you split a vector according to a pre-defined sequence?
id = zeros(numel(M), 1) ; id(1+cumsum(P)) = 1 ; id = 1 + cumsum(id(1:end-1)) ; result = accumarray(id, M(:)).' ; With...

13 years ago | 1

Answered
find where number changes in a matrix
>> [r,c] = find(diff(X,1,2)) ; >> loc = [r, c+1] loc = 2 2 2 3 3 4

13 years ago | 0

| accepted

Answered
how to delete an element from a particular position from a vector of repetitive elements
You might just want to use UNIQUE.. >> b = unique(A) ;

13 years ago | 0

| accepted

Answered
Overlapping time-intervals WITHOUT for/while loops?
*EDIT as it's not a HW* There are several methods for doing this, in particular based on ARRAYFUN/BSXFUN that perform the FOR...

13 years ago | 4

| accepted

Problem


Find names/words that start and end with the same letter.
Find names/words (from a string) that start and end with the same letter. * Case-insensitive. * If a name/word is not at the...

13 years ago | 2 | 38 solvers

Solved


Find names/words that start and end with the same letter.
Find names/words (from a string) that start and end with the same letter. * Case-insensitive. * If a name/word is not at the...

13 years ago

Answered
How do a read a text file as fixed width columns as in Excel?
You could go for something like the following: colw = [4,2,3,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5] ; buffer =...

13 years ago | 0

Answered
Xlswrite in a loop
It would be more efficient to build an array (or a cell array if you have inhomogeneous/non-numeric content) in the loop, and to...

13 years ago | 0

Answered
Missing something obvious? (fscanf)
If you need to stick to FSCANF, you can do fid = fopen('Data.txt', 'r') ; data = fscanf(fid, '%f', [24, 5]) fclose(fid) ...

13 years ago | 0

| accepted

Answered
Importing only specific entries from a text file to matlab
Regular expressions are probably your best option. Look at the following: >> s = 'Select type (A or B or C): C Enter the num...

13 years ago | 0

| accepted

Answered
How can I copy two rows
B = A(1:2,:) ; or B = A([1,2],:) ;

13 years ago | 0

Answered
how to include row pitch yaw?
Leaving for the night, but here are a few relevant topics if you want to start with a bit of theory: * <http://en.wikipedia.o...

13 years ago | 1

| accepted

Solved


Return the Nth Output from an Input Command
*Description* Given _F_, a cell array whose first element is a function handle and subsequent elements are arguments, return ...

13 years ago

Solved


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

13 years ago

Answered
I am not sure how to even get started. I am supposed to use feof to open the file but I cannot get it to work. Can anyone show me how to use feof? Thanks
In the command window, type the following command: doc feof you will find there a very illustrative example. FEOF doesn't...

13 years ago | 0

| accepted

Solved


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...

13 years ago

Solved


Rotate input square matrix 90 degrees CCW without rot90
Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

13 years ago

Solved


Find the two-word state names
Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

13 years ago

Answered
How to find subsets of a set or a column
A solution could be .. >> data = {'high', 'high', 'high', 'medium', 'low', 'low', 'low', 'medium', ... 'low', '...

13 years ago | 1

| accepted

Solved


Vectorizing, too easy or too hard?
Please insert a . before any ^, * or / in the string. That's it!!

13 years ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

13 years ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

13 years ago

Answered
Cell arrays and the unique function
You can proceed as follows: >> c = {1, 2, 3, 4} c = [1] [2] [3] [4] >> [c{:}] ans = 1 2 ...

13 years ago | 0

| accepted

Answered
How to Cope XLS Worksheet using Matlab
You can actually write data into an existing, preformated worksheet using xlswrite, because it doesn't change the format. If you...

13 years ago | 0

Answered
Is this code correct? completed HW (basis of Null(A) Col(A) and Row(A))
Hi Manuel, I can't check the methodology, but here are a few comments based on what I could see in a glimpse. *About |ColR...

13 years ago | 0

Answered
How can I avoid using a for loop
yy2 = reshape(y, [], 4) ; I named it |yy2| so you can compare with your |yy|.

13 years ago | 0

Answered
cannot get my equations to recognise my vector syntax
In A = ((1-y(:,1)-y(:,2))*0.5)+(y(:,1)*0.25)+(y(:,2)*0.75); % albedo you are trying to access all rows of column 2 of |y...

13 years ago | 0

Load more