Answered
question on addition of numbers.
when I run a=11.699124064044344*2^192 b=-17.935606820123120*2^254 c=a+b isequal(c,b) c and b are equal, that's why...

9 years ago | 0

Answered
Changing header in a set of files from the directory
*EDIT* f='C:\Users\mal\Documents\MATLAB' % your folder containing your text files fi=dir(fullfile(f,'*.txt')) file={fi.n...

9 years ago | 1

| accepted

Answered
how to generate a RANDOM matrix of 0's and 1's such that the number of 1's in any column is the same.
n=6 A=zeros(n) m=2 % number of 1 per column for k=1:n idx=randperm(n,m) A(idx,k)=1 end

9 years ago | 1

| accepted

Answered
hi . i have n observation z1 , z2, z3 , ...... zn that is numerical value and not ordered . i need partion it to interval as following
*Edit* a=min(z) b=max(z) k =3.322*log(n) %such that k number of interval L= (max(z)-min(z))/k m=fix((b-a)/L) out=[...

9 years ago | 0

Answered
How to combine 2 matrices (or vectors) element by element in order (with different sizes)?
A=1:3 B=4:6 C=[A;B] C=C(:)' %or C=reshape([A;B],1,[])

9 years ago | 1

| accepted

Answered
Problem with string assembly
V_AA = [100; 200] L_AA = length(V_AA) for i=1:L_AA F_AA{i} = sprintf('N°: %d', V_AA(i)) end %or without for loop ...

9 years ago | 0

| accepted

Answered
how to see a variable of a function in the Workspace?
function y=som(x,y,z) global a b a=x*y b=y^z y=a+b When you call the function som global a b y=s...

9 years ago | 2

| accepted

Answered
Display all the numbers of matlab
vpa(pi,40)

9 years ago | 0

| accepted

Answered
1e301-10^301 ~= 0 ?
Read this <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F>

9 years ago | 0

Answered
Array with random date find all the date belonging to the month of January using strfind.
You can use datetime function. Look at this example a={1 2 3 '01/2015';4 5 66 '01/2015';1 7 4 '02/2015'} c4=a(:,4) a=date...

9 years ago | 0

Answered
Array with random date find all the date belonging to the month of January using strfind.
Why you don't use ismember a={1 2 3 '01/2015';4 5 66 '01/2015';1 7 4 '02/2015'} idx = ismember(a(:,4),'01/2015') .

9 years ago | 0

Answered
How to Shorten This Logical Expression?
A = ismember(B,[1 2 3 7])

9 years ago | 2

| accepted

Answered
Import data 800*7 textfile into cell array using textscan
You can change your code filename = 'shipsspecs.txt'; fid = fopen(filename,'r'); if fid == -1 fprintf('Could not acc...

9 years ago | 1

| accepted

Answered
Import data 800*7 textfile into cell array using textscan
v=[]; for k=1:numel(ships_array) if iscell(ships_array{k}); v=[v ships_array{k}]; else v=[v num...

9 years ago | 0

Answered
What is the difference b/w these 2 c2d options?
I found the behavior weird, but I could find the eplanation, It seems that the function c2d recognize what method to use by read...

9 years ago | 0

Answered
Replacing the Maximum Element per Row of a Matrix with a Different Element
A=randi(100,4,5) m=max(A,[],2) A(bsxfun(@eq,A,m))=-1

9 years ago | 0

Answered
Merging two matrices where they have the same data in 1st column
A={'01/01/16', 21, 32, 43 '03/01/16', 22, 33, 44 '05/01/16', 23, 34, 45} B={'01/01/16', 0, 0, 0 '02/01/16', 0, 0, 0 '0...

9 years ago | 1

| accepted

Answered
How to calculate the delta
M={1 3 'Signal' 6 1 'Offset' 3 3 5 'Deffect' 4 0 'Offset' 6 1 3 'Signal' 6 1 'Offset' 3 3 5 'Signal' 4 0 'Offset...

9 years ago | 0

| accepted

Answered
Finding the Frequency of Unique Values
A = [ 1 1 4 3 3 3 3 2 4 1 ] [ii,jj,kk]=unique(A) freq=accumarray(kk,1) out=[ii' freq] %or freq=hist(A,1:4)

9 years ago | 1

| accepted

Answered
How to download R2016a version of matlab.
Having a 2010b Release doesn't give the right to upgrade to a 2016a R, you need to pay for it

9 years ago | 0

Answered
Detection of Falling Edge does not produce a rectangular pulse
If you have three point, false, true, false. Then you will get a triangle

9 years ago | 0

Answered
how do i find the roots of this function? the function is attached
syms x y=x^3-x^2+5*x*sin(pi*x/4-5*pi/4)+3 solve(y) To find all the roots, you can use fsolve y=@(x) x^3-x^2+5*x*...

9 years ago | 0

Answered
How to find the pixel information at a point whose coordinates are known ?
Im=randi(10,4) x=[1 2 3] y=[2 3 4] id=sub2ind(size(Im),x,y) pixels=Im(id)

9 years ago | 0

Answered
changing the cell values
A = arrayfun(@(x) randi(10,1,4),1:5,'un',0) B=cellfun(@(x) strrep(x,x(3),0),A,'un',0) celldisp(B) If the cells content ar...

9 years ago | 0

Answered
Converting a Double into a Matrix of its Digits
A = [ 123; 456; 789 ] B=num2str(A)-'0'

9 years ago | 0

| accepted

Answered
changing the cell values
A = arrayfun(@(x) randi(10,1,4),1:5,'un',0) % ---Example----- B=cellfun(@(x) [x(1:2) 0 x(4)],A,'un',0)

9 years ago | 0

Answered
Converting to a Column Vector
A = [ 1 2 3; 4 5 6; 7 8 9 ] B=char(A+'0')

9 years ago | 1

Answered
Converting to a Column Vector
A = [ 1 2 3; 4 5 6; 7 8 9 ] A*[100;10;1]

9 years ago | 1

| accepted

Answered
How can I store the output of a function in a seperate matrix?
for k=1:10 in_array=? % Define your in_array out_array = compute_c(in_array) M{k,1}=out_array end ...

9 years ago | 0

Load more