Réponse apportée
Help needed vectorizing layer-wise 3d logical indexing problem.
% Creating Sample A and B matrix A=rand(3,4); B= (rand(3,4,5))>0.5; % one liner equivalent to your code. C=mat...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
how to calculate neighbouring cells on a matrix?
use a combination of <http://www.mathworks.com/help/images/ref/padarray.html padarray()> and <http://www.mathworks.com/help/matl...

presque 9 ans il y a | 2

| A accepté

Réponse apportée
How can I use "for loop" for this script?
Looking at your code: A0=X(:,m); A1=[X(:,m-1); A0]; A2=[X(:,m-2); A1]; A3=[X(:,m-3); A2]; A4=[X(:,m-4); A3]; ...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
Load .mat file from anyfolder
load C:\myFolder\mySubFolder\myMatFile.mat or variableName= 'myVarName'; matfilePath = 'C:\myFolder\mySubFolder\myM...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
how do i convert time domain signal to frequency domain signal?
<http://www.mathworks.com/help/matlab/ref/fft.html fft()> is one

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How to select the first letter of every word
str='I like eating pizza'; str2=cellfun(@(c) c(1),strsplit(str))

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Adding SPMD results - no loop
% Creating random sample data finalImageAll{1}=rand(3,3); finalImageAll{2}=rand(3,3); finalImageAll{3}=rand(3,3); ...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
Change the values of a matrix using indices of another matrix
mask = (B==1) A(mask) = A(mask) + 5 if B is only zero and one then A(logical(B)) = A(logical(B)) + 5; and if B i...

presque 9 ans il y a | 1

| A accepté

Réponse apportée
I am trying to write a MatLab program to form a table of values for time, V(t), I(t), P(t), W(t). I have Volts and Amps, but can't insert P(t) and W(t)
t=0:.01:.25; V=10*exp(-20*t); I=-200*exp(-20*t); P=I.*V; W=0.5*(100e-6)*V.^2 table=[t;V;I;P;W]; fprintf(...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How to show Column and Row numbers in Matrix
A=[1 2 3 40 5 6 7 800 9]; format = sprintf('%%%d',max(floor(log10(A(:)))+1)); fprintf([format 'c '],'-')...

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How can I import shape file (Yield data points) and display the map?
Yes, you need Mapping Toolbox installed. Then you can use <http://www.mathworks.com/help/map/ref/shaperead.html shaperead()> ...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
Different cells with different array sizes and outputting them to textfile
assuming that *cellArray* is the variable storing your different cells; then: fid=fopen('outputfilename.txt','w'); if (f...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
Problem opening excel csv file using xlsread
for CSV file you should use <http://www.mathworks.com/help/matlab/ref/readtable.html readtable()> or <http://www.mathworks.com/h...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
aplly to matrix a probability distribution for submatrix
It appears for your case, if your kernel (or probability distribution) is symmetric you can use both <http://www.mathworks.com/h...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
Power matrix A^t using for loop without overwriting previous values
A=[0 0 0.319; ... 0.49 0 0; ... 0 0.87 0.87]; at=nan(6,1); pt=nan(6,1); for t=0:5 At=A^t; ...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
How to convert a quarterly data to annual data
Assuming all years have all 4 quarters (no missing quarter) in row or column vector, i.e.: quarterlyData=[2013q1 2013q2 201...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
speeding up a function
Ok, somehow my post got deleted. I asked whether you have other classes or there are just these two classes. here is a sample...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
cell2mat error due to element size?
Use <http://www.mathworks.com/help/matlab/ref/str2double.html str2double()> instead. C={'104', '98', '98', ...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
Reading datasets from .txt
Well something like this: filename='tmp.txt'; fid=fopen(filename,'r'); if (fid==-1) error('could not open %s for...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
remove lines in between bar
Use <http://www.mathworks.com/help/matlab/ref/stairs.html stairs()> command instead of bar to plot them

environ 9 ans il y a | 0

| A accepté

Réponse apportée
finding highest values in string
x='asdqweqweasdddasdaaaaaaaaasdeeeeeer'; y='aed'; uniqueCharsNotInY=unique(x(~ismember(x,y))); charCou...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
deleting words from a cell array
x={'areach';'aread';'areal'; ... 'areality';'arean';'arear'; ... 'areasoner';'areaway';'areca'; ... 'arecace...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
Replace an element in a vector with another element.
g=[1 2 3 4 5 6 7 8 9]; u=[1 1 3 5 4 3 7 8 9]; gout=min([g;u]) gout = 1 1 3 4 4 ...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
How to find the second zero element in an array?
index 5 is zero? You said you are looking for non-zero?!!! anyway you can use <http://www.mathworks.com/help/matlab/ref/find....

environ 9 ans il y a | 0

| A accepté

Question


Getting an error each time opening a MFile for editing?
Hi, I have this machine with MATLAB R2015b on it? it seems it has some problem, running MATLAB. Any time I try to open a M-Fi...

environ 9 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
Save while loop data?
You can do it like this: % first initialize myCoordList to an empty matrix myCoordList=[]; while (some condition)...

environ 9 ans il y a | 8

| A accepté

Réponse apportée
How to I combine different numbers of columns from two matrices?
No loop is needed. Check this: % Sample A and B A=repmat(1:4,3,1); % A has its column filled with number 1 to 4 A = ...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
Bend radius from coordinates section
You are looking to calculate Curvature. Here is the link with formula for you to calculate it: https://en.wikipedia.org/wiki/...

environ 9 ans il y a | 2

| A accepté

Réponse apportée
how can I combine two columns of an array A(m*2) in one column in the format: column1(column2)?
So, if I understood you right you have A of size Mx2 where the first column has either the character R or P and the second colum...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
rearranging a matrix and changing it dimensions
use <http://www.mathworks.com/help/matlab/ref/reshape.html reshape()> command: However, MATLAB rearranges using column order....

environ 9 ans il y a | 0

| A accepté

Charger plus