转成matlab:nbk.append( column[breaks_row[k-1]+1:].T ) lk = nnz_val[np.sort(sorted_col_args[breaks_col[k-1]+1:])]
时间: 2023-11-16 15:06:48 浏览: 80
nbk(end+1:end+length(column)-breaks_row(k-1)) = column((breaks_row(k-1)+1):end).';
sorted_col_args = find(nnz_val);
lk = nnz_val(sorted_col_args(sort(breaks_col(k-1)+1):(end-1)));
```
相关问题
转成matlab: nbk.append( column[breaks_row[k-1]+1:].T ) lk = nnz_val[np.sort(sorted_col_args[breaks_col[k-1]+1:])]
nbk = [nbk, column(breaks_row(k-1)+1:end)'];
sorted_col_args = sortidx(column);
nnz_val = find(column);
lk = nnz_val(sort(sorted_col_args(breaks_col(k-1)+1:end)));
转换成matlab:nbk.append( column[:breaks_row[k]+1].T ) lk = nnz_val[np.sort(sorted_col_args[:breaks_col[k]+1]
这是 Python 代码,转换成 MATLAB 代码如下:
nbk = [nbk column(:,1:breaks_row(k)+1)'];
[sorted_col_args, ~] = sort(col_args);
lk = nnz_val(sorted_col_args(1:breaks_col(k)+1));
阅读全文