Answered
i have a for loop and a vector in this loop that chang each loop that spend how can save this vector in all times ?
h=1000 m=zeros(1000,2) for i=1:h m(i,:)=[i i+1]; %for example end disp(m)

13 years ago | 0

| accepted

Answered
cell2mat returns an error
A= {'600'; '400'; '200'; '800'; '600'; '700'} cellfun(@str2double,A)

13 years ago | 3

| accepted

Answered
How to replace a particular string in text file
|strrep| is faster then |regexprep| f = strrep(f,'<s> ',''); f = strrep(f,' </s>',' .');

13 years ago | 6

| accepted

Answered
How to write this expression in matlab ? Boolean logic
You can check yourself p=[0 0 1 1], q=[0 1 0 1] p.^q and(p,q) or(p,q) ~p ~q

13 years ago | 1

Answered
Using .data{1,i} in a for loop
Use |Work{i}| instead of |Work(i)|

13 years ago | 0

| accepted

Answered
Using FOR IF loops to calculate MIN (NOT using MIN)
What |if A < [x y]| means?

13 years ago | 1

Answered
Solution to second order differential equation
function r = f1(t,y2,tspan1,I,J,K,L,W) r = zeros(2,1); c = zeros(length(tspan1)); r(1) = y2(2); for n =2:length(tspan1) ...

13 years ago | 1

| accepted

Answered
how can make a matrix from many vectors?
out=[A1;A2;A3;...]

13 years ago | 0

Answered
char to hex in file handling
If your data are imported in this form str={'0F4 240' '1E8 480' '2DC 6C0' '3D0 900'} a=regexp(str,'\s','split'); b...

13 years ago | 0

Answered
how to find the location of element in matrix?
I think there is an error in your expected locatn, try this I2=unique(I1(:)); ii=histc(I1(:),I2); idx1=zeros(size(I)); ...

13 years ago | 0

Answered
How do i manipulate matrix in form given below??
A=[1 2; 3 4; 5 6; 7 8] BB=reshape(A',4,[])'

13 years ago | 0

| accepted

Answered
For loop nested in while loop problem
Why are you using a for loop from 1 to 5? You are not supposed to increment n instead of m?

13 years ago | 0

Answered
find max vector form many vectors
If you have n vectors with the same size, you can create one matrix nx2. It's not a good idea to create those vectors, just use ...

13 years ago | 0

Answered
use string as a cell array.
month={'january' 'february' 'march' } month{1} month{2} % You don't need to create a variable january_ns. Can you expla...

13 years ago | 2

Answered
solving is magic function
Create a magic matrix with |magic| function then use isequal to compare your two matrices

13 years ago | 0

Answered
question on reading txt file
fid = fopen('file.txt'); line1 = fgetl(fid); res={line1}; while ischar(line1) line1 = fgetl(fid); res{end+1} ...

13 years ago | 0

Answered
How do I get MATLAB to automatically create a vector of unique values based on a known vector of values?
A=[10;20;30;100;200;10;20;30;40;50]; B=1:numel(unique(A))

13 years ago | 0

| accepted

Answered
find values in a matrix above a threshold
If M is your matrix M=[1 1 1999 15;1 1 2000 25;11 15 2020 12 ;12 31 2099 26;12 14 2100 27] N=zeros(size(M,1),6); N(:,1:3...

13 years ago | 0

Answered
How to use Display Function ?
If there is no spaces between them, that means you want to display 123 x=1; y=2; z=3; a=[x y z]; display(sprintf('%...

13 years ago | 0

| accepted

Answered
How do I join a single string with multiple strings?
basepath='/data/'; filebase='video_'; fileext='.avi'; files={'00a', '00b', '00c'} cellfun(@(x) sprintf([basepath filebase ...

13 years ago | 0

| accepted

Answered
How can I use MATLAB in image processing?
<http://www.mathworks.com/videos/getting-started-with-image-processing-toolbox-68772.html Getting Started with Image Processing ...

13 years ago | 0

Answered
How to select a matrix, row and column vector from within a matrix
Read this <http://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html> doc array

13 years ago | 1

| accepted

Answered
How to index like A(B(i), i)
n=1:size(A,2); C=A(sub2ind(size(A),B(n),n))

13 years ago | 0

| accepted

Answered
Font size change during MATLAB Text disply
Type preference

13 years ago | 0

Answered
how can i search for largest negative value in a column in a matrix and return values in the corresponding row
[max_val,idx]=max(A(:,3)) lat=A(idx,1) % corresponding latitude long=A(idx,2) % corresponding longitude

13 years ago | 0

Answered
how to convert 1D element into 2D element in a matirx?
Use find function doc find Example A=[1 2 3;4 5 6;7 8 9] [ii,jj]=find(A)

13 years ago | 0

| accepted

Answered
matrix with randperm entries
for p=1:10 s1{p}={'courses','days×','class','pro'; 'physic1',randperm(20,2),randperm(5,2),'poury'; ...

13 years ago | 0

| accepted

Answered
Wish to learn simbiology - help
<http://www.mathworks.com/videos/getting-started-with-simbiology-68959.html>

13 years ago | 1

Answered
How can I average multiple matrices by element, ignoring NaN values, to create a new matrix of the same size?
*Edit* matrixA = [2 3 5 ; 3 NaN 1 ; 2 4 3] matrixB = [3 4 NaN ; 1 2 5 ; NaN 3 5] matrixC = [NaN 2 3 ; 2 5 3 ; 1 2 1] A={...

13 years ago | 2

Answered
open a hex file
fid = fopen('file.txt'); A = textscan(fid,'%s %s %s %s %s %s %s %s') fclose(fid) A=[A{:}] arrayfun(@(x) strjoin(A(1...

13 years ago | 1

Load more