回答済み
How to read the data from a header file into single variables
Should get ya' started... >> c=textread('ma.txt','%s','delimiter','\n','whitespace',''); >> ix=~cellfun(@isempty,(strfin...

10年以上 前 | 2

| 採用済み

回答済み
Text file for loop help
Glxc = textscan(fidi, '%s', 'Delimiter','|'); Why are you reading the numeric data as strings? Read it as numeric and the...

10年以上 前 | 0

回答済み
Number of samples - how to calculate it?
8000 Hz --> 8000 samples/sec * 0.5 sec --> 4000 samples

10年以上 前 | 0

| 採用済み

回答済み
empty matrix when using textscan
*textscan* uses *fopen/fclose* to open/close the file and the subsequent file handle, _*NOT*_ the actual file name. By using th...

10年以上 前 | 0

| 採用済み

回答済み
Problems with regstats: more predictor variables than observations
In out(k,:)=regstats(RetAssets(k,i),RetMarket(k,:),'linear',{'beta','r','rsquare'}); RetAssets(k,i) is always only a sin...

10年以上 前 | 0

回答済み
Obtain equation for a curve of best fit
subplot(2,1,2), plot(fitobject1(wavelength1)) is plotting against the ordinal number of the array; to just plot over the ra...

10年以上 前 | 0

回答済み
xlswrite not writing few entries
From doc xlswrite ... Input Arguments ... A — Data to writematrix | cell array Data to write, specified as a two-...

10年以上 前 | 1

| 採用済み

回答済み
Importing rows with empty cels from EXCEL
With *xlsread* alone the only way is to specify the range and return the raw data cell array. There may be a way with the COM/D...

10年以上 前 | 0

回答済み
Improve the code's time of execution. I want to avoid the for loops and use element by element calculations. Do you guys have something in mind?? Thank you in advance.
See if the following produces correct output, first; should reduce the time slightly by eliminating redundant tests and shorteni...

10年以上 前 | 0

| 採用済み

回答済み
Trying to handle a large matrix of nx101 dimensions where n is unknown at start of loop, and I only need the previous vector to calculate the current vector
The primary one is to preallocate the array and populate rather than augmenting it. That is, start by N=1000; ...

10年以上 前 | 0

回答済み
Issue with different length of columns in a matrix.
_"length of the columns of the matrix(eg: x & y columns) vary"_ is _not_ so; there will be however many of each as there are num...

10年以上 前 | 1

回答済み
Custom labels for the axes - Problem when expanding window
If the data to plot are x = [10,20,30] then why are you setting _'xticklabel'_ at all? Just let the automagic tick values refle...

10年以上 前 | 0

回答済み
Is there any method to perform differentation of function (say f(x) =3x^2-5x-2) without Symbolic Math Toolbox?
doc polyder % for polynomials Else't you'll need to know something of the functional form to know the functional form of t...

10年以上 前 | 0

回答済み
fgetl skipping empty lines and text lines
No looping needed...as long as the numeric values are regular (ie, same number of columns each record) as shown. >> c=textr...

10年以上 前 | 0

| 採用済み

回答済み
May i ask how to know the frequency content from fast fourier transform? because i can't understand clearly from graph...Can the data from graph show in numbers?
The example of single-sided amplitude spectrum at doc fft shows clearly how to get the associated frequency axis on a pl...

10年以上 前 | 0

| 採用済み

回答済み
Error using reshape with file input
With the other comments that we're "flying blind" not being able to see the input file structure, the first issue is that ...

10年以上 前 | 0

回答済み
How to create the Hex format of the address below in MATLAB?
FAddrMax = 8389; BitMax = 1311; k=0; for i = 0:FAddrMax for j = 0:BitMax k=k+1; ...

10年以上 前 | 0

回答済み
Storing values from for loop in array and calling functions
If you've got _SimNumber_ simulations and each is _n_ by 5, then the total output needs be-- AllSimData=zeros(SimNumber*n,5...

10年以上 前 | 0

| 採用済み

回答済み
Hi everyone. I want to create a new matrix using a rand function and the values of other matrix.
IMIN=t(:,1); IMAX=t(:,2); pdf=bsxfun(@plus,IMIN,bsxfun(@times,(IMAX-IMIN),rand(p,100))) You can dispense with the int...

10年以上 前 | 1

| 採用済み

回答済み
How to extract differnt size submatrices out of a larger one using a for loop?
Presuming the answer to question above is "yes", you've got the right idea; as for processing multiple you simply make the ID a ...

10年以上 前 | 0

| 採用済み

回答済み
Undefined function 'mtimes' for input arguments of type 'struct'. Error in @(a)T*a*T' Error in blockprocFunDispatcher (line 13)
You must reference the structure field content to have an array as input to the function. Example... >> s.x=rand(2); % c...

10年以上 前 | 0

回答済み
if i have two matrix how can make them same size by add zero column or row ?
doc size doc zeros Read "Getting Started" section of documentation and work thru the tuorials on basic Matlab syntax and...

10年以上 前 | 0

回答済み
How do I index into a matrix with a vector to extract the jth column for each row?
>> A(sub2ind(size(A),[1:size(A,1)],ii)) ans = 16 11 9 14 >>

10年以上 前 | 0

回答済み
What is the highest order polynomial I can use in the polyfit function?
_"... larger order than 85, such as 95, it returns the polynomial's coefficients as NaN"_ Yeah, what is your range of x and w...

10年以上 前 | 0

回答済み
Plotting temperature vs date, which will be a combination of two array?
dates=datenum([finalmonth,finalyear]); isn't correct form for *datenum*, _"...A partial date vector has three elements, spe...

10年以上 前 | 1

| 採用済み

回答済み
How to make multiple columns one below the other making it one column?
x=xlsread('data.xls'); x=x(:);

10年以上 前 | 1

| 採用済み

回答済み
How to use least square fit in matlab to find coefficients of a function?
Matlab to the rescue!!! :) One of the most usefulest features, indeed! >> x = [7.38, 5.86, 2.46, 6.66, 0.83, 6.26, 6.61, ...

10年以上 前 | 2

| 採用済み

回答済み
How can I find the first 1 value in my binary matrix?
So what was wrong with Bruno's FEX solution? But, another solution from those posited there... >> A = randi(2,5)-1 A = ...

10年以上 前 | 0

回答済み
How to split cell array separated by ',' into double array?
>> c={'0,0,0,2,2,0.39,0.49' '0,1,2,2,2,0.34,0.44'}; >> str2num(char(c)) ans = 0 0 0 ...

10年以上 前 | 0

回答済み
if i have matrix how to do this operation on it ??
>> m=5; n=length(A); % define sizes >> F=zeros(n,m); % preallocate output >> ix=find(sum(A,2)+sum(A~=0,2)-1=...

10年以上 前 | 0

| 採用済み

さらに読み込む