回答済み
textscan formatting to import a large text file
Presuming you have a way to generate the column-wanted vector, build the format string dynamically >> c=[1,162,166 ,209,240...

約10年 前 | 0

回答済み
Please how can I unstack a column of negative and positive values into 2 columns of positive and negative values respectively?
p=sr(sr>0); % positive only n=sr(sr<0); % negative only, you'll have to decide where zero goes if it exists... or, ...

約10年 前 | 0

| 採用済み

回答済み
how can i fit a set of data to a function?
Looks like you're missing a "." in the division...I'd rewrite the equation more succinctly, however, and also use a change of va...

約10年 前 | 0

回答済み
Read specific rows from a large .csv
Untested, but check that the pattern matching format string doesn't solve the problem directly... vName='Varname_1'; ...

約10年 前 | 1

回答済み
Issue inserting file into another file at specific line
Keep the fixed portions A and B in separate files. Begin by copying part A to a new file, then write the data to that new file,...

約10年 前 | 0

回答済み
i am getting an error to plot this equation. what should i do?
Fix the lengths to match--your _theta_ isn't the same length as _time_ vector even though you wrote a loop over 1:length(time), ...

約10年 前 | 0

回答済み
Plot a function of two variables?
See example at doc meshgrid

約10年 前 | 0

回答済み
Can one read one line of string title followed by multiple lines of numeric data like FORTRAN?
As long as you don't have fixed-width fields with missing data, no problems with space-delimited files-- >> type ken.dat C...

約10年 前 | 0

| 採用済み

回答済み
how to fill a column with 1's between two specific values and with 0 otherwise?
Sometimes it's just simpler to loop... i1=find(v==1); % start i2=find(v==-1); % end if length(i2)>length(i1) % end ...

約10年 前 | 0

| 採用済み

回答済み
Moving the cross point of vertical and horizontal axes to (0,0)
If have recent version there's now a _'center'_ value on the position properties. If using earlier release, just answered a sho...

約10年 前 | 0

回答済み
token = strtok(str) Looking for Examples
My smiple-minded utility *tokens* that uses *strtok* -- function tok = tokens(s,d) % Simple string parser returns toke...

約10年 前 | 0

回答済み
Why do I get an invalid interpreter on my annotation request?
'Beta' isn't available; 'beta' is. That seems to fix it here...

約10年 前 | 0

回答済み
Open Files by File Name Patterns
Not amenable to the Matlab incarnation of the *dir* function, unfortunately--TMW has only implemented the '*' wildcard matching ...

約10年 前 | 0

回答済み
why the answer is coming as matrix and not a single number?
_" and how i can take two values for different conditions (equal pr not equal) if the answer is coming as matrix ...?"_ Well,...

約10年 前 | 0

回答済み
How to plot second y axis y2 that is just related to y1 as f(y1)
*plotyy* is about the simplest; it computes "nice" axes limits automagically that line up over the ranges of the two axes-- ...

約10年 前 | 1

回答済み
Take values from array within nested loop
_"Implement RMSE= sqrt{1/K* summation k=1:K [(theta_est-theta_true)]^2} [where] theta_est and theta_true may be of different len...

約10年 前 | 0

回答済み
Please help me in generating a matrix of ones for a given matrix
"Dead-ahead" solution is simply D = [4; 5; 3; 2; 4]; for row = 1:P ic=find(X(row,:); % the '1' column i...

約10年 前 | 0

| 採用済み

回答済み
hi,I wanted to know,if it is possible to plot some data in the same graph from two different M files?
Sure. See doc hold % 'on' after first to add to it Of course, it the two m-files are user-belligerent and do things lik...

約10年 前 | 0

| 採用済み

回答済み
Replace A single element of matrix
x(201,1)=240;

約10年 前 | 4

| 採用済み

回答済み
Plotting Legend in a For Loop
*plot* returns a _line_ handle; you're overwriting the previous handles on the subsequent passes thru the loop... j=0; % a...

約10年 前 | 1

| 採用済み

回答済み
How do I delete a specific line from a text file?
It's a sequential file so there isn't any way trivially to do what you want to the file itself. The right way would be to read ...

約10年 前 | 0

| 採用済み

回答済み
How to match two matrices in time while having different sizes?
Not clear what you intend, precisely, no...but-- If you're meaning to pick points from the more densely populated that corres...

約10年 前 | 0

回答済み
datevec text format problems
Not sure if there's a way to force the read or not but a fixup could be L=length('01/01/0000 00:00:00'); % saves me counti...

約10年 前 | 1

| 採用済み

回答済み
Matlab: NEMOH printing data on a specific line
*fgetl* is going to retrieve data from a file but *fopen(...,'w') discards any existing content in the file, if any, so you've a...

約10年 前 | 0

| 採用済み

回答済み
How do you crop a Matrix?
Pretty simply, just save what you want... Nkeep=324; % size to keep M=M(1:Nkeep,1:Nkeep); You can, of course, set th...

約10年 前 | 1

回答済み
xlsread: NaN is not recognized as Numeric Data
My release of Excel doesn't have NaN as a numeric entity; suspect it's not being returned because it isn't numeric. Look at the...

約10年 前 | 1

回答済み
Changing y axis range
How are we to know? The point of the above comment is that without knowing what you're doing there's nothing we can say specifi...

約10年 前 | 0

回答済み
Legend for two plots only applies to second plot
for i_plot = 1 : plot_step : N subplot(N, 1, i_plot) h_A = plot(bookmarksA(i_plot, :),0,'b.','MarkerSize',24); ...

約10年 前 | 1

| 採用済み

回答済み
How can I read a text file and import a part of it into matlab.
fmt=[repmat('%f',1,8) %*[^\n]']; % 8 values, skip rest of line format string fid=fopen('yourfilenamehere'); % open the ...

約10年 前 | 0

| 採用済み

回答済み
Xtick label alignment in bar plot
Variables = char('First', 'Second', 'Third',... 'Fourth', 'Large Name', 'Very Large Name', 'Small Name'); cau...

約10年 前 | 0

| 採用済み

さらに読み込む