已回答
i want to find about indexes that are chosen five from biggest number in 2-d matrix.
*Edit* A=randi(100,4,4) [val,id]=sort(A(:),'descend') max_val=val(1:5) id=id(1:5) [ii,jj]=ind2sub(size(A),id)

8 years 前 | 0

| 已接受

已回答
Reshaping 3D function to 2D
A=randi(2,2,2,2) B=repmat(A(:,:),3,2)

8 years 前 | 0

已回答
How to skip the following for loop
if(condition) A=B; else for i=1:L lines of code; end end

8 years 前 | 0

已回答
How can I find the average of Y values for a given X?
Look at this example M=randi(10,100,2) % First column is velocity varying from 1 to 10, the second is Force [V,jj,kk]=uni...

8 years 前 | 0

| 已接受

已回答
Subscript assignment mismatch.
If you delete d(1,1) what is the expected result? You can't do it unless d is a cell array For example: d=[1 2 3;4 5 6]...

8 years 前 | 0

| 已接受

已回答
Converting cell array to double?
A = { 'B 1'; 'B 12'; 'B123' } B=str2double(regexp(A,'\d+','match','once'))

8 years 前 | 1

| 已接受

已回答
How to find a inflexion point with only discrete datas?
x = [ 0 0.05 0.1 0.17 0.25 0.37 0.5 0.72 1 1.42 2 2.83 4 5.67 8 11.32 15 21.22 30 42.44 60 84.87 120 169.72 339.42 480 720 960...

8 years 前 | 1

已回答
How to count number of words in a text file?
A={'HJK.BT' 'KLP.OK' 'HJK.BT' 'POL.ST' 'HJK.BT' 'POL.ST'} [ii,jj,kk]=unique(A) freq=accumarray(kk,1...

8 years 前 | 1

| 已接受

已回答
Code to rename fiiles
f='Untitled.0001.jpg' nf=regexprep(f,'(\S+\.)(\d+)(\.jpg)','${num2str(str2num($2))}$3') Or f='Untitled4.0201.jpg' nf...

8 years 前 | 0

已回答
Creating a loop to search for matching values in two matrices
You can do it without a for loop [ii,jj]=ismember(A(:,5),B(:,1)); id=nonzeros(jj); A(ii,5)=A(ii,5).*B(id,2).*B(id,3); ...

8 years 前 | 0

| 已接受

已回答
Is it possible to extract all fields from a structure automatically?
Use fieldnames function mydata.x = 100; mydata.s = 'abc'; mydata.Y = [1 2 3]; field=fieldnames(mydata) Then you wan...

8 years 前 | 1

已回答
Creating a loop to search for matching values in two matrices
%-------Example----------------- A=randi(10,55473,10); B=randi(10,484,3); %---------------------------------- for k=1:siz...

8 years 前 | 0

已回答
If you have an input argument v that is a row-vector and another input a, that is a scalar. How do you have a function that moves every element of v that is equal to a to the end of the vector?
x= [1 2 3 4] idx=2 move=@(x,ii)[x(setdiff(1:numel(x),ii)) x(ii)] If you want to move the second number of x out=...

8 years 前 | 0

已回答
How to insert symbols in a vector in Matlab
a=[3 4 6 8 1 5 8 9 3 7 3 6 ] str=strsplit(sprintf('#%d %d@ %d$ %d< ',a) ) str(end)=[]

8 years 前 | 0

| 已接受

已回答
Extracting data from a text file into an array
M=dlmread('filename.txt')

8 years 前 | 0

已回答
Create single dimensional array from multidimensional matrix
squeeze(A(1,1,:))

8 years 前 | 0

已回答
Finding local minima for a signal
Use findpeaks(-your_signal)

8 years 前 | 4

已回答
How to check if any row has 0?
A=[0 0 0 5;1 1 4 3;1 3 4 5;2 0 0 5] out=find(~all(A,2))

8 years 前 | 1

已回答
How to find elements?
index=find(A==-ve)

8 years 前 | 0

| 已接受

已回答
delete element from vector
A=A(1:5:end) Read this <http://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html>

8 years 前 | 1

| 已接受

已回答
using ode 45 to estimate the derivative
ode=@(t, x) [x(2) ; -(1/t)*x(1)]; [t, x] = ode45(ode, [-1, 3], [0, 2]); y=x(:,1) dy=x(:,2) out=dy(3)

8 years 前 | 0

| 已接受

已回答
How can I load just one column of a table into the memory?
A=rand(10000,1) save file A If you want to load a part of A clear s=matfile(file) out=s.A(1:20,1)

8 years 前 | 0

已回答
From 2 given values find the range from a vector
*Edit* D=[110 140 160 225 280 315 355 400 450 500] Dmin=112 Dmax=356 ii1=find(D>=Dmin,1) ii2=find(D>=Dmax,1) out...

8 years 前 | 0

已回答
Using matlab function in simulink error
Your Matlab Function block is called each step time, and it depends on the value of the variable input_signal which is a scalar,...

8 years 前 | 2

已回答
What is the Fastest way to write the following algorithm
A=cell(1,5) A=cellfun(@(x) randi(10,256,256,10),A,'un',0) % ---Example---- B=cat(3,A{:});

8 years 前 | 2

| 已接受

已回答
Split 7000x4000 matrix in 10x10 matrices?
A=randi(100,7000,4000) % Example B=mat2cell(A,10*ones(700,1),10*ones(400,1)) C=cellfun(@(x) x(randi(100)),B) If you h...

8 years 前 | 0

| 已接受

已回答
Hello, so far I can't get this to respond correctly
Don't use uppercase for Matlab function, It's not Clc but clc and not If but if clc; clear r1=randperm(2,1); r2=randperm...

8 years 前 | 0

已回答
how to do zero padding for a vector?
A=[1 2 3] B=[A zeros(1,3)]

8 years 前 | 9

| 已接受

已回答
how do i implement y=nx(n-6) in matlab
n=0:10 x=@(n) n.^2 % ----Example----- y=n.*x(n-6)

8 years 前 | 0

已回答
extract large text from cell to put it into multiple cells in excel
Use xlsread to import your excel file, then do what you want with it

8 years 前 | 0

| 已接受

加载更多