답변 있음
Operands to the || and && operators must be convertible to logical scalar values. Error in logspace (line 23) if d2 == pi || d2 == single(pi)
Apparantly, one of the expressions _d2 == .._ is not a logical scalar. My first guess would be that d2 is not a scalar, but an a...

대략 12년 전 | 0

답변 있음
Splitting a string of decimal point numbers
Apparently the format of two numbers is as follows x0.yyx0.yy where *x* stands for any number of digits and *yy* are ex...

대략 12년 전 | 0

| 수락됨

답변 있음
How to count the number of consecutive numbers of the same value in an array
% data x = [1 1 1 2 2 1 1 1 3 3 3 3 3 5] % engine i = find(diff(x)) n = [i numel(x)] - [0 i] c = array...

대략 12년 전 | 3

| 수락됨

답변 있음
Column-wise AND operation in all column combinations of two matrices
% Small example: two logical arrays A = rand(3,3) > .25 B = rand(2,3) > .25 % general engine [ib,ia] = ndg...

대략 12년 전 | 0

답변 있음
how to convert a image to matrix?
M = imread('MyImage.png') M is a matrix ...

대략 12년 전 | 2

| 수락됨

답변 있음
Bit stream in to digits
You can split the string into cells % (smaller) example MyStr = '10100101010101010010101010101010' ; % a string of arbi...

대략 12년 전 | 0

답변 있음
making an array 'skip' some numbers
A = -5:0.5:-3.5 B = 3.2:0.2:3.8 C = [A B] C = sort(C) % if A and B overlap? help colon

대략 12년 전 | 0

답변 있음
Converting to a square matrix
N = numel(MyMatrix) N2 = ceil(sqrt(N)) if N2^2 > N MyMatrix(N2^2) = 0 % pads with zeros if needed end MyMatr...

대략 12년 전 | 2

| 수락됨

답변 있음
Loading tab delimited .txt file with mix of strings and numeric data
You can skip the columns you do not want: ValuesInCol2 = textread('Test28_Text_table.txt','%*s%f%*[^\n]','headerlines',1)

대략 12년 전 | 0

답변 있음
Matlab directory; keeping addpath compatible between my linux and windows
if ispc disp('I am sorry for you ;-)') ; addpath ('d:\moritz\matlab\tools') else addpath('/home/ … ') ...

대략 12년 전 | 2

| 수락됨

답변 있음
How to define a vector for multiple files
Do not use eval! files=dir('*.txt'); for i=1:length(files) tempdata = load(files(i).name, '-ascii') % now tem...

대략 12년 전 | 0

| 수락됨

답변 있음
i have 2 column of data latitude & longitude. how can i get the distance from a point(Lat-1,long-1) to all other points?
From each point to all other points, resulting in N*(N-1) distances? Take a look at PDIST.

대략 12년 전 | 0

답변 있음
how to store a changing variable matrix with the same name
Something like this? data = nan(0,8) pars = fminsearch(...) if IsChanged(pars), data(end+1,:) = pars ; end ...

대략 12년 전 | 0

답변 있음
Angle between 2 lines
You want to enter the *direction* vectors U and V into the formula dU = [diffUx diffUy] dV = [diffVx diffVy] cosT...

대략 12년 전 | 0

답변 있음
How do i solve this situation?
This problem is composed of smaller problems that you may or may not have solved. You can at least tackle them one by one _P...

대략 12년 전 | 0

답변 있음
How Looping Values Form in Array 's
If all elements of the cell array matrix have the same number of columns you can concatenate them row-wise: out = cat(1, ma...

대략 12년 전 | 0

| 수락됨

답변 있음
How to crop left eye (255*255) in this image?
This example code might give you a little insight in how to crop: A = magic(7) r = [2 6] c = [3 5] rix = r(1)...

대략 12년 전 | 0

| 수락됨

답변 있음
i have 3 column of data lat ,long &depth. how can i select depth within a range of lat& long?
Using logical indexing. Assuming data holds the three columns, try this: IsLatitudeInRange = data(:,1) > MinLatitude & data...

대략 12년 전 | 0

답변 있음
How to change Elements in Matrix per row depending on their size in reference to a particular Element (without loop)
The easy way: A([1 3 4],:) = min(A([1 3 4],:),3) ; A([2 5],:) = min(A([2 5],:),2) ;

대략 12년 전 | 1

답변 있음
strrep for more replacing using if
Remove the semi-colons and see what happens ... str = 'hello sport art art_u' ; % example string str1 = strrep(str,'spor...

대략 12년 전 | 0

| 수락됨

답변 있음
How to display a string and matrix in MATLAB?
To display some text and a matrix, you can use two disp statements. This makes the code easy to understand and maintain. For ex...

대략 12년 전 | 12

| 수락됨

답변 있음
having problem with sttrep function and empty matrix..
You are better off storing the phrases in a cell array of chars, as these phrases can have different lengths. phrasemat = {...

대략 12년 전 | 0

답변 있음
how to plot a figure with a title in Farsi or Arabic?
If you intend to use the figure in a publication, you can add or edit the text easily in powerpoint, word, adobe etc.

대략 12년 전 | 0

답변 있음
Faster or smarter way to sort and intersect large amount of data??
intersect is pretty fast, so I would not worry too much ... a = rand(100000,1) ; b = rand(100000,1) ; tic ; [c,i] = i...

대략 12년 전 | 1

| 수락됨

답변 있음
Help definitely needed! How do I load multiple txt files and change the varible names of each to include the date from file
You can use cell or structs. MyFiles = {'midas_wind_197701-197712.txt','whatever.txt','another name.txt'} for k=1:nume...

대략 12년 전 | 0

답변 있음
Scatter plot with different colours
Using GSCATTER is not that difficult: matrix1 = rand(10,2) ; % [X,Y] data matrix2 = rand(10,1)>0.5 ; % Grouping (0 o...

대략 12년 전 | 0

답변 있음
Subscript indices must either be real positive integers or logicals.while using indexing
Are you sure they are *positive and larger than zero* ? … I am pretty sure they are not! remove the semi-colon to see ...

대략 12년 전 | 1

답변 있음
Finding each element of one array in another array
help ismember Take a look at it's second output ...

대략 12년 전 | 0

| 수락됨

답변 있음
Is there a way to make a plot of a line with different colors?
To plot lines as well: % some data x = linspace(0,1,100); y = rand(1,length(x)); tf = y >= 0.5 ; y2 = y ; y...

대략 12년 전 | 0

| 수락됨

답변 있음
Cumulative sum for every 15min from 1 min timeseries data
Do you want to sum up the 15 minutes to a single number and then proceed to the next 15 minutes? V = ceil(5*rand(33,1)) ; %...

대략 12년 전 | 0

| 수락됨

더 보기