Respondida
Can I use dlmread() twice within a function?
One way to do this is to load all data, and then split into Matrix1 and Matrix2. I assume you want Matrix1 to have all columns e...

casi 9 años hace | 0

Respondida
how to sutract specific elements in a long array?
y = x; %make copy of x y(7:11) = x(7:11)-0.5; %you had it right %Or, you could do this. same thing: y(7:11) = y(...

casi 9 años hace | 1

| aceptada

Respondida
hello guys, please help me what is the error in this code.tqvm
|code.tqvm| should be renamed to |code.m| . Matlab does not recognize .tqvm files. run the code in MATLAB as >> code ...

casi 9 años hace | 0

Respondida
A way to optimize this piece of code..
First, let's look at the original code and see how to improve that. Then I'll show the vectorized code. %Making up some vari...

casi 9 años hace | 1

| aceptada

Respondida
How to take only first part of the string
If dealing cell array with only strings: A = { 'HaH' '16 years' '14'; 'Tay' '23' '23 s'; 'YAH' ...

casi 9 años hace | 0

Respondida
MATLAB data type expression problem
The issue is caused because MATLAB uses <https://www.mathworks.com/help/symbolic/increase-precision-of-numeric-calculations.html...

casi 9 años hace | 0

| aceptada

Respondida
How to generate plot of a function?
It was almost right, but a few things needed some changes. See comments in the code. To run this on the command line: >> nx...

casi 9 años hace | 0

| aceptada

Respondida
Outputting arrays from function in for loop
Going to use nio.sigma instead of sigma, since sigma is a matlab function and NOT a constant that you want in your function dT. ...

casi 9 años hace | 0

| aceptada

Respondida
How can I store each roll from a for loop as a matrix?
Do you need to generate random numbers by round, or can you generate them all at once? If you can do the latter, here's one solu...

casi 9 años hace | 0

| aceptada

Respondida
Echo off or semicolon in GUI
* It makes sense to use |echo off| pretty much every time. Although |echo on| is used for debugging purposes, there are better w...

casi 9 años hace | 0

| aceptada

Respondida
How to detect rain automatically and then remove rain to provide clear image MATLAB code???
DID YOU LOOK AT MATLAB FILE EXCHANGE??? <https://www.mathworks.com/matlabcentral/fileexchange/57416-rain-removal-from-still-i...

casi 9 años hace | 0

Respondida
Parallel CPU for lattice Boltzmann Method
<https://www.mathworks.com/products/parallel-computing/code-examples.html> Here're some tutorials and sample that you could s...

casi 9 años hace | 0

| aceptada

Respondida
How to remove identical matrix
%Create a cell array of matrices with same cols but diff rows and values for k = 1:5 M{k} = 100*rand(k, 6); end ...

casi 9 años hace | 0

| aceptada

Respondida
Adding continuously to get a sum of how many words there are
NEW ANSWER: treats a word as one that starts with a letter function wordcount = getWords str = 'jeff john 2lion lion2 th...

casi 9 años hace | 1

| aceptada

Respondida
Using fprintf to print in text file
New solution: works for words separated by non-letter characters (ex: dog, cat, "bird") function extractWords(input, outpu...

casi 9 años hace | 0

Respondida
Find a common element between two matrices of different sizes
Use <https://www.mathworks.com/help/matlab/ref/intersect.html |intersect|> . C = intersect(A, B) C = 11

casi 9 años hace | 1

| aceptada

Respondida
How to access struct values
There is no |coef_arraysim| field in |im|, hence the error message. I do see something close, |coef_arrays|, which stores 3 ...

casi 9 años hace | 0

| aceptada

Respondida
How to effectively concatenate values in cells with different dimension into single column double
C{1} = [1 2 3]; C{2} = [4 5 6 7 8]; C{3} = [9 10]; D = cat(2, C{:}); D = 1 2 3 4 5 6 7 8 9...

casi 9 años hace | 0

| aceptada

Respondida
How can I Count every word with three or more syllables in each group of sentences, even if the same word appears more than once.
The only way you can do this is by using a database of word-syllable. Here's one way using www.dictionary.com as the database. ...

casi 9 años hace | 1

| aceptada

Respondida
Hi i'm new to Matlab. i have directory : C:\D\Test and inside the ''Test'' i got sub folders A,B,C,D and E. i have a m.file called ''test.m'' in each sub folder. i wanna automate the run each test.m starting from A and then until E .
You also have to remove the '.' and the '..' directories that are returned by |dir| dirinfo = dir('C:\D\Test'); dirinfo(...

casi 9 años hace | 0

| aceptada

Respondida
How can I make a movie with one multidimensional matrix in MATLAB
VidObj = VideoWriter('movie.avi', 'Uncompressed AVI'); %set your file name and video compression VidObj.FrameRate = 30; %se...

casi 9 años hace | 1

| aceptada

Respondida
Individual handles for each plot in a loop
I would avoid using handle_plotCD1, handle_plotCD2, BUT, this can be done via something call <https://www.mathworks.com/help/mat...

casi 9 años hace | 1

| aceptada

Respondida
Problem removing negative numbers from my vector using for loop.
Since you need a loop, consider creating a logical index matrix and then changing this where the negative numbers are. After the...

casi 9 años hace | 1

| aceptada

Respondida
How can I find the distance between webcam and red dot laser point.
measuring tape, from an actual toolbox

casi 9 años hace | 0

Respondida
Calculate the remaining index of my data
%Getting index of an arbitrary matrix [x, y] = find(ones(5, 'logical')); x = [x y]; %Remove index i == j x(x(:,1...

casi 9 años hace | 1

Respondida
What's the procedures I have to follow to overcome this problem?
As the error message is suggesting, the image file does not exist - meaning it cannot find it in your current working directory ...

casi 9 años hace | 0

| aceptada

Respondida
GUI report error if something is wrong
You could use try/catch statements where you use the xlsread function. Edit the code in your callback function like this: t...

casi 9 años hace | 0

| aceptada

Respondida
Why do I get assertion failed?
What is the assertion statement being used? Here're what I see is wrong / odd with your function: # *F* is actually the pi va...

casi 9 años hace | 0

Respondida
How to make matrix after using findpeaks?
This is one way to do this, but you have to fill in the unused space with something like NaN. C{1} = [1, 0.35315, 0.35267,...

casi 9 años hace | 0

| aceptada

Respondida
How to use multiple struct files using for loop
How are you loading your files? To fix this, you have to go one step back to file loading step so that you can loop. Currently, ...

casi 9 años hace | 1

Cargar más