已回答
what does [^\n\r]' mean?
"^" is a negation. |%[^\r\n]| matches everything *but* line break, i.e. the rest of the line. Doc says Exclude characters...

12 years 前 | 2

| 已接受

已回答
extracting one data point per day from a time series
This produces a bar chart %% fid = fopen( 'cssm.txt', 'r' ); cac = textscan( fid, '%s%f', 'Delimiter' ,...

12 years 前 | 0

| 已接受

已回答
How to replace a column in a txt file
With xls-files it possible _"to edit a specific column"_. See <http://www.mathworks.se/help/matlab/ref/xlswrite.html xlswrite, W...

12 years 前 | 1

已回答
Command Line statements for a matrix
Ok, here is one way of doing a) >> m = magic( 3 ) m = 8 1 6 3 5 7 4 ...

12 years 前 | 0

| 已接受

已回答
Instead of clicking 'publish', I want to write a code for it which makes use of saved settings. How?
See: <http://www.mathworks.se/help/matlab/ref/publish.html?searchHighlight=publish publish, Generate view of MATLAB file in spec...

12 years 前 | 0

| 已接受

已回答
The Variable appears to change size on every loop iteration
This is not an error, it's a warning. It is inefficient to change size of a variable in a loop. However, the if-statement mak...

12 years 前 | 2

| 已接受

已回答
Why are the 2 lines at the end so time consuming?
I run your example on R2013a 64bit, Win7, and and old vanilla desktop. Our line number differs. You stripped off 18 lines in the...

12 years 前 | 1

已回答
How to read a.txt file in matlab
Comments * The Mathworks recommend |textscan| over the older |textread| * The delimiter in your file is space, char(32) * M...

12 years 前 | 0

| 已接受

已回答
how to append multiple CSV files with mix of numeric / non-numeric into one final table
Assumptions: * the files have the same format and are "correct" - no checking needed * the first character of all file na...

12 years 前 | 0

| 已接受

已回答
a specific colormap for filled contour plot
Yes, you can make a special colormap to accomplish that * see <www.mathworks.se/help/matlab/ref/colormapeditor.html colormape...

12 years 前 | 0

已回答
matrix ismember of another matrix
%% A=[1 2 3 4 5]; B=[2 4]; %% C = setdiff( A, B ) returns C = 1 3 5 ...

12 years 前 | 0

| 已接受

已回答
How to import around 1000 text files and then convert them from cnv files to matlab files and then organize them in a structure with their original file name?
Allocate the structure with this statement before the for-loop data = struct('Filename',{FILES.name},'lat',[],'long',[]);...

12 years 前 | 0

已回答
What is the problem in the for loop?
That is hard to tell based on the information you provide. However, here are some links on debugging in Matlab * <http://blog...

12 years 前 | 0

| 已接受

已回答
Why won't matlab use all logical cores?
* Matlab is single threaded. However, some functions use more than one core. * Solution: <http://www.mathworks.se/help/distco...

12 years 前 | 0

已回答
How do you store variables atfer each iteration of a for loop to use later?
Try %% u = nan(94,3); v = nan(94,3); for n=1:94 u(n,:) = [n,n+1,n+2]; v(n,:) = [n,n*1...

12 years 前 | 0

已回答
Problem in setting xtick labels
Try change '1/13' to ' 1/13' to make the length of *all* strings the same.

12 years 前 | 1

| 已接受

已回答
Another regexp parsing question
The "+" should be after "]" %% str = '.text 0x54a65b23 0x45 (hello)'; cac = regexp( str, '0x[0-9a-fA-F]+', 'mat...

12 years 前 | 2

| 已接受

已回答
Regexp parentheses string parsing issue
Not the most robust expression, but it works in this case str = 'Hello (string_here.d) (string)'; cac = regexp( str,...

12 years 前 | 2

| 已接受

已回答
Quicker function than repmat to multiplay matrices with vectors?
Try to use <http://www.mathworks.se/help/matlab/ref/bsxfun.html bsxfun, Apply element-by-element binary operation to two array...

12 years 前 | 3

| 已接受

已回答
CAT arguments dimensions are not consistent using mldivide
Without values of e12, e21, e22, etc. we cannot find out why this error is thrown. Here are some links on debugging in Matl...

12 years 前 | 0

| 已接受

已回答
Which function will cause less load to Matlab?
Both alternative appears a bit problematic * 3000 lines littered with if-statements sounds difficult to get right and mainta...

12 years 前 | 0

已回答
split a cell matrix into sub-matrices
Hint: >> C{1,1} = rand(100,10); >> sub = C{1,1}( [2:4], [1:6] ) sub = 0.5576 0.4866 0.3355 0....

12 years 前 | 0

| 已接受

已回答
What do I need to change to output variables larger than 2 GB in MATLAB?
See <http://www.mathworks.se/help/matlab/ref/save.html?searchHighlight=save save>. Use proper mat-file version. You already have...

12 years 前 | 0

已回答
How to create a vector from a random point cloud?
In the File Exchange see * <http://www.mathworks.com/matlabcentral/fileexchange/9896-2d-histogram-calculation 2D Histogram Ca...

12 years 前 | 0

已回答
How can I convert a matrix into a number?
Try >> sprintf( '%1d', matrix ) ans = 1101011

12 years 前 | 0

已回答
Generating random integer from -x to x
See <http://www.mathworks.se/help/matlab/ref/randi.html randi, Uniformly distributed pseudorandom integers> for integer numbers ...

12 years 前 | 1

已回答
How to create a data vector on matlab by starting from a specific date.
With this approach, one need to worry less about floating point errors sdn = datenum( 2014, 1, 1, [0:1:1000], 0, 0 ); ...

12 years 前 | 0

| 已接受

已回答
How to add values from vector
A Matlabish way >> sum( reshape( ones(1,10), 5, [] ) ) ans = 5 5 it assumes that the length of v1 i...

12 years 前 | 0

| 已接受

已回答
textscan - line by line multiple outputs
See documentation <http://www.mathworks.se/help/matlab/ref/textscan.html?searchHighlight=textscan textscan, Read formatted data ...

12 years 前 | 0

已回答
Fail Reasons exportable in the UnitTest-Framework?
This line picks up most of the output from the test msg_str = evalc('results = run( test_runner, test_suite );');

12 years 前 | 0

加载更多