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...

mehr als 13 Jahre vor | 4 | 205 Lösungsvorschläge

Gelöst


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...

mehr als 13 Jahre vor

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

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 13 Jahre vor | 1

Beantwortet
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

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
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) ;

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 13 Jahre vor | 4

| akzeptiert

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...

mehr als 13 Jahre vor | 2 | 40 Lösungsvorschläge

Gelöst


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...

mehr als 13 Jahre vor

Beantwortet
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 =...

mehr als 13 Jahre vor | 0

Beantwortet
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...

mehr als 13 Jahre vor | 0

Beantwortet
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) ...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 13 Jahre vor | 0

| akzeptiert

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

mehr als 13 Jahre vor | 0

Beantwortet
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...

mehr als 13 Jahre vor | 1

| akzeptiert

Gelöst


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 ...

mehr als 13 Jahre vor

Gelöst


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 ...

mehr als 13 Jahre vor

Beantwortet
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...

mehr als 13 Jahre vor | 0

| akzeptiert

Gelöst


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...

mehr als 13 Jahre vor

Gelöst


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)....

mehr als 13 Jahre vor

Gelöst


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...

mehr als 13 Jahre vor

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

mehr als 13 Jahre vor | 1

| akzeptiert

Gelöst


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

mehr als 13 Jahre vor

Gelöst


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...

mehr als 13 Jahre vor

Gelöst


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...

mehr als 13 Jahre vor

Beantwortet
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 ...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 13 Jahre vor | 0

Beantwortet
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...

mehr als 13 Jahre vor | 0

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

mehr als 13 Jahre vor | 0

Beantwortet
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...

mehr als 13 Jahre vor | 0

Mehr laden