【问题标题】:Saving output in the form of an array以数组的形式保存输出
【发布时间】:2015-08-09 05:19:14
【问题描述】:

我想将输出 out 保存为当前输出为的列向量的形式

ans(:,:,1) =
 0
ans(:,:,2) =
 0
ans(:,:,3) =
 0
ans(:,:,4) =
 0
ans(:,:,5) =
 0
ans(:,:,6) =
 0
ans(:,:,7) =
-5.5511e-017

function [out]= myfun1(in)
in= importdata('X.dat');
l= length(in);
dt=0.05;
l1=(l-1)*dt+1;
ts = timeseries(in, 1:.05:l1);
ts1= resample(ts, 1:1:l1);
out= ts1.data;

【问题讨论】:

  • squeeze它。
  • 谢谢!它可以得到一个列向量。如果我想直接从输出中获取行向量,而不是对挤压后形成的列向量进行转置,该怎么办?
  • reshape(out,1,[]) 可能是解决方案。

标签: arrays matlab output sampling


【解决方案1】:

我认为您可能对整个输出有问题。我假设您想在采样点1:1:l1 处对向量“in”重新采样。 Resample 应该被称为:

resample(timeseriesVector, UpsampleValue, DownsampleValue)

这将以 UpsampleValue/DownsampleValue 的速率生成一个新的时间序列向量。

如果我误解了您的意图,我很抱歉。如果您可以提供一些基本的示例数据,可能会更容易调试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-07
    • 2015-02-20
    • 2015-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多