Réponse apportée
Regular expression forward slash clarification
The slash is a basic literal. They wanted to work with roughly the same example for the three cases, and they built a pattern wh...

plus de 11 ans il y a | 2

| A accepté

Réponse apportée
How to read the PRE html tags and replace some white spaces
I've got to run, but here is one way (I'll come back later to discuss further if needed). *EDIT:* the first solution could no...

plus de 11 ans il y a | 3

| A accepté

Réponse apportée
How do I call the first number in a string?
If the text just contains letters followed by numbers, an efficient way to proceed is as follows; num = string - '0' ; f ...

plus de 11 ans il y a | 3

Réponse apportée
Read csv strings, keep or create surrounding whitespace
Here is an example that I can refine if you provide more information. It writes some keywords in upper case.. key = {'lobste...

plus de 11 ans il y a | 1

| A accepté

Réponse apportée
Convert cell-array to array-of-cells, for array-of-struct creation?
To = cellfun( @(cc)num2cell(cc), Fr, 'UniformOutput', false ) ; To = [To{:}] ;

plus de 11 ans il y a | 1

Réponse apportée
Convert space separated string table to cell?
>> Dec = reshape( hex2dec( regexp( reshape( Table', 1, [] ), '..\s?', ... 'match' )), 8, [] )' Dec = 162 ...

plus de 11 ans il y a | 4

| A accepté

Réponse apportée
How can I create another matrix with the sum of every 30 rows in a 14,400 by 11 matrix?
Here are a couple additional ways, if you need a sum for each block of 30 days (not a "moving" sum), assuming that your original...

plus de 11 ans il y a | 1

Réponse apportée
Creating a diagonal matrix which contains already defined matrix on diagonals??
Here is an example which builds a block diagonal matrix |A| based on 3x3, trivially time-dependent matrices t = 0 : 3 ; ...

plus de 11 ans il y a | 1

Réponse apportée
How can I plot the same data with two y-axes on the same plot?
You probably made a mistake, how are you calling PLOTYY? doc plotyy and look at examples, and e.g. the following which wo...

plus de 11 ans il y a | 2

Réponse apportée
Remove elements appearing sequentially in a larger text.
Here is an example using pattern matching and replacement.. % - Get and modify content. fName = 'tord_1.txt' ; content...

plus de 11 ans il y a | 2

Réponse apportée
Clear text typed with input() from the command history
It may be a bit violent but com.mathworks.mlservices.MLCommandHistoryServices.removeAll would work. And welcome back! ...

plus de 11 ans il y a | 1

Réponse apportée
Relatively complex matrix indexing question
You are correct about sparse matrices, and I had completely misunderstood your setup! So the lower triangular part is NaN, but t...

plus de 11 ans il y a | 1

| A accepté

Réponse apportée
How to create average of values within a grid box??
You are trying to perform what is called a <http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000w8000000.ht...

plus de 11 ans il y a | 6

| A accepté

Réponse apportée
How to import large textfile
Here is one way to proceed fId = fopen( 'omar_1.txt', 'r' ) ; buf = fscanf( fId, '%f', Inf ) ; fclose( fId ) ; bSize...

plus de 11 ans il y a | 2

| A accepté

Réponse apportée
How to pass a function handle of an anonymous function into ode45 function in matlab?
Assuming that your problem has 3 dimensions, so you have for example x0 = [10; 5; 7] ; % [x1(0), x2(0), x3(0)], or...

presque 12 ans il y a | 6

Question


Why not making accounts creation more complicated?
We've seen a *dramatic* increase of the spam that we get on the forum lately, and I am wondering if it isn't the right moment fo...

presque 12 ans il y a | 2 réponses | 12

2

réponses

Réponse apportée
How to extract a number of diagonals of a matrix
*Sparse, SPDIAGS* - Here is a version using sparse matrices and SPDIAGS Original, dense matrix: >> N = 5 ; >> A = randi...

presque 12 ans il y a | 4

Réponse apportée
Split along word into parts with different lengths
Here is a solution based on comments above. Yet, we will need you to answer these comments so we can refine the approach. Assumi...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
Find duplicate entries and average associated values
If elements from the first column are "continuous" positive integers, here is a way to go: >> data = [1 10; 2 20; 3 30; 4 40...

presque 12 ans il y a | 5

Réponse apportée
Read specific hex data in CSV file
*NEW solution* Here is a more efficient solution; I am using a 122MB file, so you have an idea about the timing % One lin...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
Find elements greater than a value corresponding to the second array
loc = B > 0.875 ; % Logical index of elements of B greater than 0.875. val = A(loc) ; % Values of A at...

presque 12 ans il y a | 2

| A accepté

Réponse apportée
Split one array into two while splitting each cell
Assuming that you have data = {'13008KT', '08009KT', '13009KT', '13008KT'} ; here one way to go: >> data = cat( 1, ...

presque 12 ans il y a | 2

Réponse apportée
after fundamentals what is the next course for a physics student?
I don't have much time but I'll bring my 2 cents too, and develop two points. *A.* You have to make the distinction between t...

presque 12 ans il y a | 2

| A accepté

Réponse apportée
Using textscan with mixed data type in a single field/array
If you don't need |N| and |T|, the simplest approach is probably to eliminate them before the call to TEXTSCAN: content ...

presque 12 ans il y a | 4

| A accepté

Réponse apportée
Reading values from a text file and converting to array.
Here is one way to achieve what you want to do: >> content = fileread( 'myFile.txt' ) ; >> data = textscan( content, '%f (...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
textscan difficulties with mixed datatypes
Why do you get the CSV content as a cell array of rows? If you cannot change this, you could just merge/concatenate all these ro...

presque 12 ans il y a | 3

| A accepté

Réponse apportée
Fast way to read text file of formatted data
You should/could perform this operation using a *RAM drive/disk*. There is little interest in saving temporary files on disk whe...

presque 12 ans il y a | 2

Réponse apportée
String value and relate with number.
Here is one solution. Assuming W = ['DABCD'] ; Define values = [21, 12, 8, 7] ; % or values = [A, B,...

presque 12 ans il y a | 1

Réponse apportée
How to present elements of a cell array?
s1n = reshape(sscanf([s1{:}],'%s%d'),3,[]) ; s2n = reshape(sscanf([s2{:}],'%s%d'),3,[]) ; [id2,id1] = find(bsxfun(@eq,s1n(3...

presque 12 ans il y a | 2

Réponse apportée
Track changes in a cell array with strings
Here one way to proceed: [~,ia] = unique( arrayfun( @(r)[C{r,2:end}], 1:size(C,1), 'Unif', 0 )) ; C_chg = C(sort(ia),:) ...

presque 12 ans il y a | 3

| A accepté

Charger plus