Answered
How can add the rows in n-by-m matrix that have the same indicator in the last column?
You can use accumarray function A=[253638 3309 3 223389 3309 2 255968 3309 2 243943 33309 2 245568 63309 1 242490 9330...

10 years ago | 0

Answered
How to: Sharing variable from one function to another function in GUI
You can pass them as arguments

10 years ago | 0

Answered
Assignment and accessing using indices
k = zeros(4,4); v = [2,3]; idx=sub2ind(size(k),v,v) k(idx) = 1;

10 years ago | 1

| accepted

Answered
How to remove parentheses from all single words in a string?
s='(G5)*((G6)*(G2+G4))+(G2)*(-(G4+G6)*(G1))+(G4)*(-(G6)*(G3))' [i1,i2]=regexpi(s,'\<\([a-z0-9]+\>\)') s([i1 i2])=[] Or ...

10 years ago | 1

| accepted

Answered
How can I convert a 3D matrix to 2D matrix in the way specified in this post
a=permute(val,[2 1 3]) out=a(:,:)'

10 years ago | 0

Answered
How to use interp1 with data neither in increasing order nor decreasing order.
x=0:2:10 % is sorted y=rand(size(x)) % y is not sorted xi=[1 3 5] yi=interp1(x,y,xi) If this is what you've asked, th...

10 years ago | 0

Answered
summing to create a vector
n=20 t= linspace(0,4*pi,1001); for k=1:n s(k)=sum((-1)^k *sin((2*k+1)*t)/((2*k+1)^2)) ; end s

10 years ago | 1

Answered
Can you pre-compile .m files to make them faster?
You can create an executable, using the Matlab Compiler, or create a C++ code for example, using a Matlab coder. But there is no...

10 years ago | 0

Answered
vector manipulation in matlab
w=[v repmat(a,1,n)]

10 years ago | 0

Answered
How to count matrix values in positions specified by other matrix?
out=nnz(ismember(A,[11 12]).*B) or out=nnz(ismember(A(logical(B)),[11 12]))

10 years ago | 0

| accepted

Answered
The integer data sructures such as int8 or int16 has NaN values?
you can use cell array for that a=[1 2 nan 3] idx=isnan(a); b=num2cell(uint8(a)) b(idx)={nan} Now you can check the c...

10 years ago | 0

Answered
How to enter characters in cell array ?
A=sprintf('a_%d',1:99)

10 years ago | 0

Answered
Is it accepted to change counting index within a for cycle?
Yes you can. Look at this example out=[] for k=1:3 k=k+5 out=[out k] end But each loop k will have values i...

10 years ago | 0

Answered
what are the supported compilers for compiling mex files in matlab R2013a of 64bit windows 8?
<http://www.mathworks.com/support/sysreq/files/SystemRequirements-Release2013a_SupportedCompilers.pdf?sec=win64>

10 years ago | 0

Answered
How to take a common particular part of string
s={'PR.VK0K200E5T00_T123' 'PR.VBK0K800E3F00_R243' 'PR.VP124K800E5T00' 'PR.ZVK0K10E5T00_T123_FF99'} out=regexp(s,'\d+E\d+',...

10 years ago | 0

| accepted

Answered
Is it possible to create and save integer vectors in MATLAB?
Look at uint8, uint16,... <http://www.mathworks.com/help/matlab/numeric-types.html Numeric type>

10 years ago | 0

| accepted

Answered
How to change polarity/sign of values of a vector for a defined range of another corresponding one to one vector ?
idx1=pahse>=0 & phase<5 idx2=phase>=5 $ phase<=1 value(idx1)=-abs(value(idx)) value(idx2)=abs(value(idx2))

10 years ago | 1

| accepted

Answered
how to delete rows from matrix
out=test_ary(~ismember(test_ary,[0 0 0],'rows'),:)

10 years ago | 0

Answered
Delete table row if var1 not equal to certain string
%-------------------Example------------------------ s={ 'Algeria',1 2;'United States' 3 4;'France' 6 7} A=cell2table(s) %...

10 years ago | 0

| accepted

Answered
How to sqrt a vector n times?
n = 30; x = 0:0.001:2 x=x.^(1/2^n)

10 years ago | 0

Answered
How to create a 3d stack of multiple images in Matlab
Depending on how your images are named, this line of code should look like images{i} = imread(sprintf('000%d.tif',i));

10 years ago | 1

Answered
How to take first three characters of string
str={'MA0K123T0' 'MB0JHY210I9' 'AoTkU08' '880KE21L' 'PMB456KU0'} out=cellfun(@(x) regexprep(x,'\<(M|P).+',x(1:3)),str,'un...

10 years ago | 0

| accepted

Answered
Compare a string to all values in column and extract rows where such Strings are found
idx=ismember(NYCdata_extract(x,2),'Bank') out=NYCdata_extract(idx,:)

10 years ago | 0

Answered
How to solve non linear equations with two unknowns?
syms x1 x2 eqn1 = -(49*sin(x1 + x2) - 120*cos(x1) + 20*cos(x2) + 392*sin(x1) - 10)/(30*cos(x2) + 110) eqn2 = -(539*sin(x1 +...

10 years ago | 0

Answered
Extract formatted table text
A={'$123' ; '$425'} A=strrep(A,'$','')

10 years ago | 1

| accepted

Answered
can i know the way to code the square wave in Matlab?
You can use square function <http://www.mathworks.com/help/signal/ref/square.html> t=0:0.01:20; y=square(t,50), plot(t,...

10 years ago | 0

| accepted

Answered
need to find numbers divisible by 2 through 100
There is a problem with your initialization, it should be zero instead of empty variable. divby=[]; ndivby=[]; And also...

10 years ago | 0

Answered
How can i set the parameter of simulink block from my gui ?
Check the name of your Gain block

10 years ago | 0

Load more