Beantwortet
How do I get regexp to read specific values in a text file?
I assumed that you forgot the |Platform| field in the first line of your sample data and took the following instead: Platfor...

etwa 13 Jahre vor | 2

Beantwortet
Summing nonsequential elements in a matrix
|magic(50)| is a square, 50x50 matrix. What do you want to achieve? Is it summing elements [5 7 19 33 34 35 36 47 50] of row 1 o...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
how to find overlapping intervals?
If boundaries are integer, a solution can built based on CUMSUM for building interval IDs and DIFF or UNIQUE for finding boundar...

etwa 13 Jahre vor | 1

Beantwortet
Changing property attributes in a value class
I don't think that this _"hide and reveal"_ approach is sound/wise. You can implement whatever logic in your methods so they wor...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
matrix from arrays of different size
I don't understand where 0 NAN 1 0 2 1 3 2 4 3 is coming from, but why do you need to have results in a single array? If ...

etwa 13 Jahre vor | 0

Beantwortet
Is MATLAB is automatically concatenating data from a text file?
What are you trying to achieve, extract the numbers? The space in the pattern |' +'| won't match tabs actually, but |'\s+'| woul...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
Incorporating Structure Fields into a Function as Inputs
I am not sure that I understand what you are trying to do .. so you have a class e.g. |Transline|, which contains a method |crea...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
Quickest way to convert numeric array to a cell array of strings
Ok, to be honest, my issue at this point is that this approach is not that common, and I can't figure out whether you are an exp...

etwa 13 Jahre vor | 0

Beantwortet
How can I extract arrays from a structure?
There is no such thing as |vals(i).data|. If you wanted to save only the 7 relevant columns, you could update a little your c...

etwa 13 Jahre vor | 0

Beantwortet
regriding an irregular matrix
A general approach could be the following, assuming that you have this matrix |A| with datenums in the first row. [y, m] = d...

etwa 13 Jahre vor | 0

Beantwortet
CSV: Create New Headerline
Assuming that there is no comma but tabs ( |\t| ) as delimiters, I give you one way to do it: % - Read input file data conte...

etwa 13 Jahre vor | 2

| akzeptiert

Beantwortet
Is there way to suppress the timer?
Just use a |;| at the end of the line with the |toc|: >> tic ; pause(1) ; t = toc ; Here there is no output for example, ...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
Matrix: Find corresponding elements in a different column
Ok, I understand; do you need columns to be separate? If not, you could go for the following solution: assume the whole dataset ...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
Applying regexpi to csv file
So it is true that your CSV has not comma as delimiter? The general approach is to use TEXTREAD, TEXTSCAN, FSCAN, etc when yo...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
is there a more efficient way to omit certain characters from a string without using loops?
One way would be newsf = regexprep(sf, '([CREP1-4]|SQ)', '') ; but what does "etc" encompass?

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
Convert Cell to String
You could use something like: s = sprintf('%s\n', x{:})

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
Problem Importing Data from a CSV file
You can also use TEXTREAD, as follows: [t, p] = textread('myFile.csv', '%s %f', 'delimiter', ' ', 'headerlines', 1) ;

mehr als 13 Jahre vor | 0

Beantwortet
Reading in a file name with a zero
You probably want to do something like this: for imgId = first : last fileLocator = fullfile(source, sprintf('IMG_%04d...

mehr als 13 Jahre vor | 1

Beantwortet
want to calculate the sum of the numbers appear in an array that is mix of NaNs and numbers
It is not trivial actually. Look at the following and let me know if there is anything unclear. Also, I let you check that it ma...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
how to call a specific variable in matrix inside loop process..??
Here is an answer based on what I understood, and a truncated version of |xdata| in which I removed the last row that contains a...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
String Match for Plotting in Excel
If states had no space in their names, or if you had commas as delimiters in the CSV file, you could go for a variant of [s...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
How to calculate conditional sum of a part of vector/array based on a 2nd one
The following is an example of "vector approach": dif = [true, diff(B)~=0] ; blockId = cumsum(dif) ; blockSt...

mehr als 13 Jahre vor | 2

Beantwortet
Why is regexp including extra data?
*EDIT:* if all words that you want to extract *are known a priori*, Per gave you the answer. Your pattern is too generic; it ...

mehr als 13 Jahre vor | 1

Beantwortet
What does each line do?
If we execute the following in our command window (you'll have random numbers different from mine, and I work with 10 of them in...

mehr als 13 Jahre vor | 1

Beantwortet
Problem with Forward Euler function?
You should build a simple case study outside of this function. It seems that you want to build an array whose rows contain the e...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
How to search the continuous values with maximal size in a vector ?
You can go for a solution around the following: boundary = find([true, abs(diff(a))~=1, true]) ; [blockSize, boundaryStart...

mehr als 13 Jahre vor | 2

| akzeptiert

Beantwortet
Please help me with a while loop problem
The first thing that is not correct is the condition in the WHILE statement; you want to repeat the loop while the amount is bel...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
Static class call via string variable
Yes, you can proceed the same way as with dynamic field names: myObject = myClass() ; methodName = 'foo' ; x = myObj...

mehr als 13 Jahre vor | 1

Beantwortet
How to convert an nXn matrix into n/numXn/num matrix containing the sum of elelments
There is no function, up to my knowledge, that does this automatically (as you can see <http://www.mathworks.com/matlabcentral/a...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
Assign cell elements from a cell array to another cell array
Curly brackets mean "content of" (and generate a comma-separated list when you use them with a range); they don't perform block ...

mehr als 13 Jahre vor | 5

| akzeptiert

Mehr laden