回答済み
how to multiply and concatenate at same time?
Kronecker product would be suitable if we could apply it along a given dimension, but it seems that we can't. As an alternative,...

約13年 前 | 0

| 採用済み

回答済み
how i can select an indice in vector and matrix
If you are sure that |phix| and |tx| will be entered so they match exactly elements of |T| and |phi|, you can do the following: ...

約13年 前 | 1

| 採用済み

回答済み
how to get the most repeated element of a cell array?
the cyclist >> *I knew I had overlooked something easier. :-)* Well, look at how *I* did _overlook something easier_ ;-D : ...

約13年 前 | 0

| 採用済み

回答済み
What is the Sutable Laptop with MATLAB?
To be honest, the main thing that I would pay a lot of attention to is to make sure that whatever graphic card you take, it has ...

約13年 前 | 0

回答済み
extract from text file
New version, taking into account your last comment. fname_in = 'myFile.txt' ; fname_out = 'myFile.xlsx' ; headerSize ...

約13年 前 | 1

| 採用済み

回答済み
Function giving incorrect answer
It was almost correct; you just forgot to assign the result to an output argument (that I named "result" below, but you are free...

約13年 前 | 0

| 採用済み

回答済み
Loading ascii data file with headers
The following would be an option: [index, distance, tip_A] = textread('myFile.txt', '%d %f %f', 'headerlines', 3) ;

約13年 前 | 1

回答済み
Good non-specialized book for MATLAB
You could use the PDFs mentioned here: <http://www.mathworks.com/matlabcentral/answers/73550-starting-matlab-and-not-experien...

約13年 前 | 1

回答済み
How to add any number of variables together in all combinations?
You can use NCHOOSEK. You should avoid using EVAL actually, which is quite slow, and rarely appropriate. Also, look at the doc o...

約13年 前 | 1

回答済み
Transposing blocks of matrices from a bigger initial matrix
So you don't have |A|, |B|, |C|, etc, but a large |M| that you have to split/transpose/cat? If I understand well what you wan...

約13年 前 | 2

| 採用済み

回答済み
replacing NaN with zeros in a cell column of strings
You can go for something like: A(cellfun(@(x)all(x~=x), A)) = {0} ; but it is just "cosmetic" (in some sense) and the loo...

約13年 前 | 1

回答済み
some errors when i try to use the code of snake
You are calling |parse_inputs| without passing any argument, whereas it requires one (at least). After this call (where neither ...

約13年 前 | 1

回答済み
How to vectorize writing to a txt file
You could go for something like this: buffer = sprintf('(%f,%f),', [time; signal]) ; % FormatSpec repeated. buffer(end)...

約13年 前 | 0

| 採用済み

回答済み
Batch Process for CSV files
It seems that you have two levels of loops, yet you are using the same loop index for all loops. This creates a conflict (essent...

約13年 前 | 0

回答済み
How to transfer a sparse matrix into a block diagnal matrix efficiently?
I would go for something like: % - Build example case. K = 3 ; N = 4 ; A = sparse(randi(10, K*N, N)-1) ; % - Extr...

約13年 前 | 0

| 採用済み

回答済み
load columns from file with headlines and dates
Assuming that the date/time column has always the same format, the first value starts at char 22 and you can do something like: ...

約13年 前 | 0

回答済み
Values of intersection points of plot. Print results.
*EDIT:* this answer is *wrong*, I answered too quickly without paying attention to the fact that your |x| is the output of an OD...

約13年 前 | 0

回答済み
How to make and save image for each iteration in a for loop?
I understand now; you'll want something like: filename = sprintf('mat_img_%d.jpg', n) ; imwrite(B, filename, 'png') ; N...

約13年 前 | 0

| 採用済み

回答済み
Deleting empty rows in a 3D Cell Array in MatLab
If you want to be able to remove rows from single "pages", you should use a cell array of cell arrays, e.g. A = cell(3, 1) ;...

約13年 前 | 1

| 採用済み

回答済み
improve efficiency of a matlab code that includes for loop and if statement
It really depends whether BLKIMPV can work on vectors. If so, you can go for something like: dataset = zeros(size(data9,1), ...

約13年 前 | 0

| 採用済み

回答済み
Passing a .txt file as a function parameter
You should pass file names to the function and/or a base path. filenames = {'a.txt', 'b.txt'} ; % Cell array of fi...

約13年 前 | 1

| 採用済み

回答済み
Large Sparse Matrix Summation
Why can't you use a loop? Is |K| that large? If you are looking for efficiency, I'd say that you could directly build |A| in ...

約13年 前 | 0

回答済み
updating a second matrix in specific lines as you loop through a first one
If elements of column 1 of |AAA| are really positive integers, you can create |BBB| as a vector and index the element in |BBB| w...

約13年 前 | 0

| 採用済み

回答済み
How can I separate similar values in an array?
You can use an approach based on the following: % - Define threshold (max diff. that doesn't break a group). threshold = ...

約13年 前 | 0

回答済み
How to add values to already existing ones in a matrix using for loop?
Like this: KG = zeros(size(Ke)) ; % Prealloc (are they same size?) % and initia...

約13年 前 | 1

回答済み
Why am I getting this error "??? error using ==> times matrix dimensions must agree" in matlab?
You have to transpose either |wk| or |hd|, because one is a column vector and the other a row vector. E.g. hn = hd .* wk.' ...

約13年 前 | 0

| 採用済み

回答済み
How can I optimize code for explicit scheme?
You can compute A = repmat(a(2:N_space-2), 1, N_v) ; B = repmat(b(2:N_space-2), 1, N_v) ; C = repmat(c(2:N_space-2), 1, ...

約13年 前 | 0

回答済み
create vector that consists only of zeroes
err = zeros(size(data13,1), 1) ; but don't call it "error" as it is the name of a function.

約13年 前 | 0

| 採用済み

回答済み
How do I keep updating and accumulating my arrays as I read multiple files one after the other
You could go for something like: words = {} ; for k = 1 : 2 buffer = fileread(sprintf('testing%d.m', k)) ; words ...

約13年 前 | 1

| 採用済み

回答済み
any ideas how to make the code more efficient? Now it takes a few days!
You probably want to do something like the following (to adapt to your case, *and check that it is working*): n_img = 200 ; ...

約13年 前 | 0

| 採用済み

さらに読み込む