답변 있음
Analyse and make pattern from csv file
You will have to define a little better what you want to extract when errors are logged, but here is an example using REGEXP: ...

13년 초과 전 | 0

답변 있음
Multiplying matrices as cells - 4 dimensional with variable no. of matrices (code works now!)
As you have only a limited number of values for |f|, you should avoid using complicated 3D or 4D arrays (indexing them is not al...

13년 초과 전 | 0

| 수락됨

답변 있음
Data Saving - Storage Efficiency
>> f_dbl = 1 ; >> f_log = true ; >> whos Name Size Bytes Class Attributes f_dbl 1x1 ...

13년 초과 전 | 0

문제를 풀었습니다


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

13년 초과 전

답변 있음
More Efficient Assignment Operation - Sparse Matrix
See: <http://www.mathworks.com/matlabcentral/answers/69528-sparse-matrix-more-efficient-assignment-operation>

13년 초과 전 | 1

답변 있음
Not sure what I'm doing wrong. FOR LOOP
Difficult to know without seeing your sequence, but imagine that the cell array |codons| contains 60 characters.. when t = 60, a...

13년 초과 전 | 0

답변 있음
Sparse Matrix - More Efficient Assignment Operation
The structure of sparse matrices in memory makes this kind of indexing operations slower than building the sparse matrix directl...

13년 초과 전 | 2

답변 있음
How many times does each number appear?
Hi Hamad, Well, how large is "extremely large"? Image Analyst might have given you the optimal solution already. As an altern...

13년 초과 전 | 2

답변 있음
Form strings/numbers from matrix
If you want numbers: >> A = [1 2 0; 0 2 6; 9 8 0; 0 0 2] A = 1 2 0 0 2 6 9 8 0 ...

13년 초과 전 | 1

| 수락됨

답변 있음
create n arrays in matlab
If you really want to build |n| separate arrays, you will have to store them in a cell array, unless you want to dynamically gen...

13년 초과 전 | 1

답변 있음
Is there a clean way to find the number of elements in a vector that are "near" a specified constant?
Yes, you can proceed as follows: >> n = sum(abs(A-100) < 5) n = 8

13년 초과 전 | 0

| 수락됨

답변 있음
how do i create a recursive function that gives the number of digits in an integer? i.e. does the same that length function does in MATLAB
As Wayne mentioned, recursivity in unnecessary, but if you had to implement a recursive function, you could have built something...

13년 초과 전 | 1

| 수락됨

답변 있음
read a number after a specific string in a txt file
As it's a bit more elaborate than your previous question, it might be time to go for a regexp solution (even though you can alwa...

13년 초과 전 | 3

| 수락됨

답변 있음
Faster Method for removing duplicates
>> node_u = unique(node, 'rows', 'stable') node_u = 0.1234 5.6789 3.4567 9.8765 4.5678 8.7654 shou...

13년 초과 전 | 1

| 수락됨

답변 있음
compute the repetition of a string in a text file
Your best option for pattern matching is usually regular expressions (regexp). In this particular situation where the pattern...

13년 초과 전 | 0

| 수락됨

답변 있음
Merging cell arrays with variable number of elements
x = {A, B{:}, C} ; In this expression, |B{:}| is a comma separated list (CSL); it is equivalent to listing |B|'s cells' cont...

13년 초과 전 | 0

| 수락됨

답변 있음
colon operation (:) causes parfor to fail on cell array
It has a priori nothing to do with PARFOR; the expression involving the colon on the left hand side is a comma separated list (C...

13년 초과 전 | 1

답변 있음
Deleting Zero Rows - Matlab Noob
B(B(:,1)==0,:) = [] ;

13년 초과 전 | 4

| 수락됨

답변 있음
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
An optional *chat room* with a *main channel* and *thread-specific channels* or user defined channels would be awesome. The rati...

13년 초과 전 | 0

답변 있음
Using TEXTSCAN to import an ASCII file with a header and blank lines between different data sets
An alternative could be to use REGEXP to get blocks of data, e.g. in a struct array, and then post-process the content. To illus...

13년 초과 전 | 2

| 수락됨

답변 있음
Maximize similarity of vectors
I've never done anything like that, but you picked my curiosity so I gave it a quick try.. v1 = [1 1 2 1 2 3 3 1 1 2] ; v...

13년 초과 전 | 0

답변 있음
Finding durations between 1's in a matrix
If you had the following matrix |I| for example: >> I = rand(10,5) > 0.6 I = 0 1 1 0 0 0 1...

13년 초과 전 | 0

문제를 풀었습니다


Convert a cell-array of values to MATLAB source code
The MATLAB interpreter loads your code and executes it using the Read-Evaluate-Print-Loop (see <http://en.wikipedia.org/wiki/REP...

13년 초과 전

답변 있음
How to randomly shuffle cards?
Look at the doc for RANDPERM. You can use it to shuffle a set of 1 to N integers: >> randperm(12) ans = 5 8 ...

13년 초과 전 | 0

답변 있음
How to avoid using a global variable in this case
I thought that you were talking about OOP with your initial question, but if not, it is not a good idea to overload common opera...

13년 초과 전 | 0

답변 있음
What is not "a finite, nonsparse, real integer vector" but looks like one? Error using circshift>ParseInputs (line 71)
>> A = rand(4) > 0.5 A = 1 0 0 0 1 0 1 1 0 0 0 1 0 1 1 ...

13년 초과 전 | 0

답변 있음
fgetl drops part of line
Could you copy/paste here the first 10-20 lines of one of these files? Have you tried to read the full file in one shot and then...

13년 초과 전 | 0

답변 있음
Matlab function/code similar to excel vlookup?
Look at this example: >> x = [1, 4, 2, 5, 3, 7, 6] ; % Fake x and y. >> y = x + 10 ; >> for k = 1 : 7, y(x == k), ...

13년 초과 전 | 0

답변 있음
Improve result of text file
If you evaluate class(R{3}) class(R{1:2}) you will realize that these are cells/arrays. You need to index one step furt...

13년 초과 전 | 0

답변 있음
Analysis and Prediction of Optimal Array Size of Pre-allocation.
Depending the nature of your computation, you can get an "analytical estimate", e.g. " _memory usage grows like_ |n^2|" for a gi...

13년 초과 전 | 0

| 수락됨

더 보기