답변 있음
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...

8년 초과 전 | 0

답변 있음
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(...

8년 초과 전 | 1

| 수락됨

답변 있음
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 ...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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' ...

8년 초과 전 | 0

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

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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. ...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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 ...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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

8년 초과 전 | 1

| 수락됨

답변 있음
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 ...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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. ...

8년 초과 전 | 1

| 수락됨

답변 있음
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(...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

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

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 1

답변 있음
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 ...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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,...

8년 초과 전 | 0

| 수락됨

답변 있음
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, ...

8년 초과 전 | 1

더 보기